我的项目中出现了这个异常:
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)
我的目标api是23;
我的构建工具是classpath 'com.android.tools.build:gradle:1.5.0'
导致这种情况的aar使用的是dagger,rxjava和otto。因此,寄存器功能用于otto。
我该如何解决?
让我更加困惑的是,我在6.0设备中运行此应用程序,但dalvik.system包中发生异常
还有什么,我检查我的apk中的dex文件。它表明,之前添加的两个aar是在同一个dex文件中,即我项目中的第二个dex文件(我使用谷歌的mulltidex工具将我的应用程序拆分为多索引)