search

Home  >  Q&A  >  body text

android - java.lang.IllegalAccessError: Class ref in pre-verified class

  1. 描述你的问题
    java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation

安卓找个错误提示是什么意思吗?有研究过的分享一下吗?
我查看网上的信息,说修改Go to modules -> dependencies, then set scope of the lib to 'Provided'.

但是修改了也还是出错。但是整个程序在真机测试没问题....

  1. 贴上相关代码

  2. 贴上报错信息

    .NativeStart.main(Native Method)
    02-09 20:18:58.763 20941-20941/com.china.chinasix E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.china.chinasix.MainActivity.access$super
    02-09 20:18:58.763 20941-20941/com.china.chinasix E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.china.chinasix.MainActivity.access$super
    02-09 20:18:58.763 20941-20941/com.china.chinasix E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.china.chinasix.MainActivity.access$super
    02-09 20:18:58.763 20941-20941/com.china.chinasix E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.china.chinasix.MainActivity.access$super
    
  3. 贴上相关截图

  4. 已经尝试过哪些方法仍然没解决(附上相关链接)

http://www.4byte.cn/question/836435/java-lang-illegalaccesserror-class-ref-in-preverified-class-resolved-to-unexpected-implementation.html

ringa_leeringa_lee2772 days ago634

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 15:46:41

    I have encountered this error before. The reason should be that certain classes are repeatedly referenced in your project, and I estimate that you did not compile it through static compilation, but dynamically loaded dex, and the two dex may contain The same part of code still references each other, so dex2 originally had part of the code in dex1, but it was not loaded due to conflicts, so it referenced that part of the code in dex1, which would cause this error.

    The solution is to check whether a library is referenced repeatedly, or a library contains another.

    reply
    0
  • Cancelreply