二、Java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or
2017-06-30 16:05
2181 查看
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
相关文章推荐
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- Android java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
- java.lang.NoSuchFieldError: No static field ib_back of type I in class Lcom/example/demo/R$id; or
- java.lang.NoSuchFieldError: No static field txt_content of type I in class Lcom/test/
- NoSuchFieldError: No static field btn_press3 of type I in class Lcom/hyphenate/helpdesk/R$id; or its
- java.lang.NoSuchFieldError: no "I" field XXXXin class "Lxx/xx/xx/xx;" or its superclasses
- android java.lang.NoSuchFieldError: R$id.xxx 异常
- android java.lang.NoSuchFieldError: R$id.xxx
- android java.lang.NoSuchFieldError: R$id.xxx
- hive Exception in thread "main" java.lang.NoSuchFieldError: type
- java.lang.NoSuchFieldError:包.R$id.xxx
- java.lang.NoSuchFieldError: No field title of type
- java.lang.NoSuchFieldError:No static field adbxxx
- android java.lang.NoSuchFieldError: R$id.xxx
- java.lang.NoSuchFieldError: No field title of type I
- java.lang.NoSuchFieldError:包.R$id.xxx
- java.lang.IllegalArgumentException: No converter found for return value of type: class XXX.XXXX
- Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE