天使漫步IT工作室天使漫步IT工作室

NoSuchFieldError: No static field 解决办法


Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 110

Warning: count(): Parameter must be an array or an object that implements Countable in /www/wwwroot/u11u.com/usr/themes/wq/functions.php on line 116

原因是因为项目存在多个module,而module和module之间或者module和app之间存在同名的布局文件命名。

解决方式及原因:

I had activity_main.xml layout in one of my other modules as well, so I was getting this NoSuchField error. I rename the layout in one of my modules and it worked.

翻译:我有一个命名为activity_main.xml 的layout布局文件在一个module上(app里面默认也有一个activity_main.xml),然后就产生了这个NoSuchField error的错误,当我重命名其中一个文件以后,程序就跑起来了。

所以解决的办法及原因:将其中的一个命名改名字或者删除(如果布局一样就删除)。

参考文章:NoSuchFieldError: No static field-stackoverflow.com

本站原创,欢迎转载,转载敬请标明出处:天使漫步IT工作室 » NoSuchFieldError: No static field 解决办法
添加新评论


Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /www/wwwroot/u11u.com/usr/themes/wq/comments.php on line 38