java.lang.RuntimeException:无法获取提供者android.arch.lifecycle.LifecycleRuntimeTrojanProvider

时间:2017-11-09 11:44:24

标签: android-studio android-gradle

我的应用程序一直崩溃,在我将Android Studio更新到3.0后,当我的应用程序在API级别19设备上运行时,此错误不断弹出。此应用程序适用于以前的Android Studio。此外,该应用程序现在适用于API级别24设备。

P.S。 - 我知道这个问题之前曾被问过一次,并且它是重复的。但这些解决方案都不适合我。

java.lang.RuntimeException: Unable to get provider android.arch.lifecycle.LifecycleRuntimeTrojanProvider: java.lang.ClassNotFoundException: Didn't find class "android.arch.lifecycle.LifecycleRuntimeTrojanProvider" on path: DexPathList[[zip file "/data/app/com.bayasys.bayatrade.mobile-76.apk"],nativeLibraryDirectories=[/data/app-lib/com.bayasys.bayatrade.mobile-76, /vendor/lib, /system/lib]]
                                                       at android.app.ActivityThread.installProvider(ActivityThread.java:5236)
                                                       at android.app.ActivityThread.installContentProviders(ActivityThread.java:4828)
                                                       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4711)
                                                       at android.app.ActivityThread.access$1600(ActivityThread.java:175)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:146)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5602)
                                                       at java.lang.reflect.Method.invokeNative(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:515)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
                                                       at dalvik.system.NativeStart.main(Native Method)
                                                    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.arch.lifecycle.LifecycleRuntimeTrojanProvider" on path: DexPathList[[zip file "/data/app/com.bayasys.bayatrade.mobile-76.apk"],nativeLibraryDirectories=[/data/app-lib/com.bayasys.bayatrade.mobile-76, /vendor/lib, /system/lib]]
                                                       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                       at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
                                                       at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
                                                       at android.app.ActivityThread.installProvider(ActivityThread.java:5221)
                                                       at android.app.ActivityThread.installContentProviders(ActivityThread.java:4828) 
                                                       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4711) 
                                                       at android.app.ActivityThread.access$1600(ActivityThread.java:175) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:146) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5602) 
                                                       at java.lang.reflect.Method.invokeNative(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:515) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099) 
                                                       at dalvik.system.NativeStart.main(Native Method) 

1 个答案:

答案 0 :(得分:3)

我遇到了类似的问题。我通过将Application类扩展到MultidexApplication来解决它。