本文主要是介绍java.lang.NoSuchFieldError:包.R$id.xxx,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
找了很久这个异常的解决方法。在http://stackoverflow.com/questions/10937496/chris-banes-android-pulltorefresh-java-lang-nosuchfielderror-com-handmark-pull上找到了解决办法。
将引用的自定义控件的xml文件中的最外层布局上面添加
xmlns:sat=“http://schemas.android.com/apk/res/控件所在位置的包名”可是在运行时就会报java.lang.NoSuchFieldError:包.R$id.xxx错。同时还会出现no resource identifier found for attribute 的错误。
将
更改为xmlns:sat=“http://schemas.android.com/apk/res/控件所在位置的包名”
http://schemas.android.com/apk/res-auto 就不会报错了
这篇关于java.lang.NoSuchFieldError:包.R$id.xxx的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!