1

我创建了具有多个依赖项的 Android 应用程序,并且超过了 65,536 个方法限制。为了解决这个问题,我使用了Google guide

不幸的是,当我添加android:sharedUserId="android.uid.system"AndroidManifest.xml时出现异常:

Caused by: java.lang.ClassNotFoundException: 
akka.actor.LightArrayRevolverScheduler
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:308)
        at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:67)
        at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:66)
        at scala.util.Try$.apply(Try.scala:191)
        at akka.actor.ReflectiveDynamicAccess.getClassFor(DynamicAccess.scala:66)
        at akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:84)
        at akka.actor.ActorSystemImpl.createScheduler(ActorSystem.scala:677)
        at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:576)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:142)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:119)
        at akka.actor.ActorSystem$.create(ActorSystem.scala:67)
        at akka.actor.ActorSystem.create(ActorSystem.scala)
        at CENSORED
        at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:923)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:5940)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
 Caused by: java.lang.ClassNotFoundException: Didnt find class "akka.actor.LightArrayRevolverScheduler" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at android.app.LoadedApk$WarningContextClassLoader.loadClass(LoadedApk.java:533)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:308)
        at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:67)
        at akka.actor.ReflectiveDynamicAccess$$anonfun$getClassFor$1.apply(DynamicAccess.scala:66)
        at scala.util.Try$.apply(Try.scala:191)
        at akka.actor.ReflectiveDynamicAccess.getClassFor(DynamicAccess.scala:66)
        at akka.actor.ReflectiveDynamicAccess.createInstanceFor(DynamicAccess.scala:84)
        at akka.actor.ActorSystemImpl.createScheduler(ActorSystem.scala:677)
        at akka.actor.ActorSystemImpl.<init>(ActorSystem.scala:576)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:142)
        at akka.actor.ActorSystem$.apply(ActorSystem.scala:119)
        at akka.actor.ActorSystem$.create(ActorSystem.scala:67)
        at akka.actor.ActorSystem.create(ActorSystem.scala)
        at CENSORED
        at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:923)
        at android.os.Handler.handleCallback(Handler.java:739)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:145)
        at android.app.ActivityThread.main(ActivityThread.java:5940)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1389)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
Suppressed: java.lang.ClassNotFoundException: akka.actor.LightArrayRevolverScheduler
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 27 more`

这表明 MultiDex 在启动过程中无法正常工作,因为apk中有classes.dexclasses2.dex

是的,我有权使用android.uid.system,并且在其他情况下也可以正常工作。

有没有办法解决这个问题?

4

0 回答 0