今天当我从github上下载一个工程,并把它的库文件导入eclipse中,发现switch语句报错case expressions must be constant expressions : 解决方法是: 先把那个工程的properties->android->is Library勾选上的勾去掉 然后clean一下工程就好了: 因为这个工程我要作为另一个工程的库文件, 所以最后还是要继续勾选上is Library哦! 不过这次不会报错啦! 当然要想根本解决就是把switch-case语句换成…
今天无意中碰见了   case expressions must be constant expressions 的问题 写了一个 switch(item.getItemId()) { case R.id.action_settings: Toast.makeText(this ,"action_settings" ,Toast.LENGTH_LONG).show(); System.out.println("onOptionsItemSelected"); bre…
在项目中遇到这样的Exception:case expressions must be constant expressions public class StandingCityActivity extends Activity implements View.OnClickListener{} @Override public void onClick(View v) { switch (v.getId()) { case R.id.back: break; default: break;…
刚才导入android zxing 条码 的demo测试,发现出现如下错误 case expressions must be constant expressions 经检查,项目被设置成library了,在project.properties 文件中将 android.library=true 这一句删去,再clean一下项目即可运行…
调用react-native-fs插件时,如果数据的接口是需要验证信息的,在android上运行报错,而在iOS上运行没问题.原因是因为接口是有验证信息的,而调用这个插件时没有传入,在iOS上会自动加上验证信息,而 android需要手动设置. 此错误的解决方法: 1.在调用登录接口时,保存下cookie(cookie在response里),在调用react-native-fs时放在headers里传入,代码如下: _appLogin(userName, password, callback){…
android sdk启动报错error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 问题原因:端口5037被占用 解决方案: 方式一:可以用cmd命令 C:\Users\Administrator>netstat-ano | findstr "5037"                 <<<<<-------------查看5037 被谁占用,…
SQL语句报错(一) 1.具体报错如下: ORA-01861:文字格式字符串不匹配 01861. 00000 - "literal does not match format string" *Cause:Literals in the put must be the same length as literals in the format string (with the exception of leading whitespace). If the "FX"…
假如我们数据库中有两张表Person和Book Person表: CREATE TABLE [dbo].[Person]( ,) NOT NULL, ) NULL, ) NULL, [CreateTime] [datetime] NULL, [UpdateTime] [datetime] NULL, CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMP…
mysql5.7执行sql语句报错:In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'yunva_changke.u.user_id'; this is incompatible with sql_mode=only_full_group_by 1.方法1,需要重启mysql服务 编辑/etc/my.cnf文件,加入如下参数,重启mysql sql_m…
数据库查询语句报错-ORA-00911: invalid character 根据自己经验总结下: 1.都是分号惹的祸,有时候sql语句后面有分好导致这种错误 2.还有一种是从别处copy过来的sql语句,中间的空格是中文导致的,这个很难发现 3.还有一种可能是字符编码问题,不过是这种问题的可能性很小 用户可以自己尝试下是哪一种导致的.…