AS开发中出现Error(二)——Java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or

来源:互联网 发布:skype聊天软件下载 编辑:程序博客网 时间:2024/06/16 20:49
Java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses

原因:
1、调用findViewById的顺序是否在Activity中onCreate或Fragment中onCreatedView的setContentView方法之后
2、这里有提示R$id的问题,那你看看是不是引用了多个库,而有同名的layout布局

解决:在报错的对应的class中的布局layout名字重新命名

参考:http://www.th7.cn/Program/Android/201608/946598.shtml

阅读全文
0 0