1. 程式人生 > >E/CrashReport: java.lang.NoSuchFieldError: No field iv_icon of type I in

E/CrashReport: java.lang.NoSuchFieldError: No field iv_icon of type I in

集成了一個module後報錯:

E/CrashReport: java.lang.NoSuchFieldError: No field iv_icon of type I in class Lcom/example/overlaylib/R$id; or its superclasses (declaration of 'com.example.overlaylib.R$id' appears in /data/app/com.example.fashionaly.jswatcher-2/base.apk)
                                                                                   at com.example.overlaylib.OverLayManager.initFloatIconView(OverLayManager.java:387)

原因:我app中有與匯入module相同的佈局檔案,所以整合後衝突。

解決方案:將app或者匯入的module的佈局檔名改成一個唯一的檔名。衝突解決。