PrototypeZ / AppJoint

🔧 Cross module Android development made easy!
764 stars 120 forks source link

Multidex 怎么破 #12

Closed trevorwang closed 5 years ago

trevorwang commented 5 years ago

java.lang.IllegalAccessError: Illegal class access: 'io.github.prototypez.appjoint.AppJoint' attempting to access 'com.xxxxx.xxxx.xxxxxxxxx' (declaration of 'io.github.prototypez.appjoint.AppJoint' appears in /data/app/com.xxxx.xxxxxxx-1/base.apk:classes2.dex)

PrototypeZ commented 5 years ago

你好,您这里的情况看上去向多次 appjoint 在dex中出现了多次,请问您这边是怎么一个引用路径?请问是否方便加一下我微信 zjnb1114 便于定位一下呢?

trevorwang commented 5 years ago

上面的问题在打开 instant run之后运行通过, 不过在4.4 模拟器上还有问题

11-30 09:37:18.911 2292-2292/xxx.xxx.xxx E/dalvikvm: Could not find class 'xxx.xxx.xxxx', referenced from method io.github.prototypez.appjoint.AppJoint.<init>
11-30 09:37:18.911 2292-2292/xxx.xxxx.xxxx E/AndroidRuntime: FATAL EXCEPTION: main
    Process: xxx.xxx.xxx, PID: 2292
    java.lang.IllegalAccessError: tried to access class xxx.xxx.xxxx from class io.github.prototypez.appjoint.AppJoint
        at io.github.prototypez.appjoint.AppJoint.<init>(AppJoint.java:26)
        at io.github.prototypez.appjoint.AppJoint.<init>(AppJoint.java:18)
        at io.github.prototypez.appjoint.AppJoint$SingletonHolder.<clinit>(AppJoint.java:104)
        at io.github.prototypez.appjoint.AppJoint.get(AppJoint.java:100)
trevorwang commented 5 years ago

切记:必须保证class是public的,才可以跨dex调用