0

I got this exception in my project:

 No pending exception expected: java.lang.IllegalAccessError: com.mogujie.mgjpfbasesdk.fragment.PFBaseFragment
06-28 20:36:33.834 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class dalvik.system.DexFile.defineClassNative(java.lang.String, java.lang.ClassLoader, java.lang.Object) (DexFile.java:-2)
06-28 20:36:33.834 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class dalvik.system.DexFile.defineClass(java.lang.String, java.lang.ClassLoader, java.lang.Object, java.util.List) (DexFile.java:226)
06-28 20:36:33.834 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class dalvik.system.DexFile.loadClassBinaryName(java.lang.String, java.lang.ClassLoader, java.util.List) (DexFile.java:219)
06-28 20:36:33.834 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class dalvik.system.DexPathList.findClass(java.lang.String, java.util.List) (DexPathList.java:338)
06-28 20:36:33.834 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:54)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:511)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:469)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class java.lang.Class.classForName!(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:324)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Class java.lang.Class.forName(java.lang.String) (Class.java:285)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.String com.mogujie.commanager.MGJComManager.onIntentInterceptedInternal(java.lang.String, android.content.Intent) (MGJComManager.java:114)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.String com.mogujie.commanager.MGJComManager$MGJHmInterceptor.activity(java.lang.String, android.content.Intent) (MGJComManager.java:140)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void com.mogujie.commanager.internal.hack.MGJHDelegate.handleActivity(android.os.Message) (MGJHDelegate.java:316)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at boolean com.mogujie.commanager.internal.hack.MGJHDelegate.handleMessage(android.os.Message) (MGJHDelegate.java:148)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:98)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void android.os.Looper.loop() (Looper.java:148)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:5417)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:726)
06-28 20:36:33.835 13192-13192/com.mogujie.uni A/art: art/runtime/thread.cc:1321]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:616)

My target api is 23;

And my build tools is classpath 'com.android.tools.build:gradle:1.5.0'

The aar which causes this is using dagger, rxjava and otto. Thus, the register function is for otto.

How can I solve it

Which confused me more is that, I run this app in a 6.0 device, but the exception happens in dalvik.system package

What's more, I check the dex files in my apk. It shows that, the two aar added before is in the same dex file, i.e. the second dex file in my project (I use google's mulltidex tool to split my application to multidexes)

zccneil
  • 139
  • 11
  • http://stackoverflow.com/questions/7076414/java-lang-illegalaccesserror-tried-to-access-method – johnrao07 Jun 28 '16 at 12:50
  • I have checked this answer out, but it seems no effect to my problem . Which confused me more is that, I run this app in a 6.0 device, but the exception happens in dalvik.system package – zccneil Jun 28 '16 at 13:09
  • the dalvik.system classes were obviously named when dalvik was the VM. But they're part of the public API, so renaming them now that we have ART really isn't an option. – JesusFreke Jun 28 '16 at 17:43

0 Answers0