2
我嘗試使用Android的體系結構組件,其做工精細的API 21+ 但在API 14:Android的架構組件與API 14
java.lang.RuntimeException: Unable to get provider android.arch.lifecycle.LifecycleRuntimeTrojanProvider: java.lang.ClassNotFoundException: android.arch.lifecycle.LifecycleRuntimeTrojanProvider
at android.app.ActivityThread.installProvider(ActivityThread.java:4240)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:3992)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3946)
at android.app.ActivityThread.access$1300(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1185)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: android.arch.lifecycle.LifecycleRuntimeTrojanProvider
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.ActivityThread.installProvider(ActivityThread.java:4225)
Dependensies
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support.constraint:constraint-layout:+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'android.arch.lifecycle:runtime:+'
compile 'android.arch.lifecycle:extensions:+'
annotationProcessor "android.arch.lifecycle:compiler:+"
implementation 'com.android.support:support-v4:26.+'
}
有什麼辦法要解決這個問題?
看看這個問題。可能與您的問題有關https://stackoverflow.com/questions/44075089/noclassdeffounderror-landroid-arch-lifecycle-lifecycledispatcher – Neil
是的,我看到了您的解決方案,但對我來說它不起作用 – Hagakurje
不是我的解決方案,只是看到回答並認爲它可能有所幫助。 – Neil