gpt4 book ai didi

java - NoClassDefFoundError Landroid/arch/lifecycle/LifecycleDispatcher

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:24:22 26 4
gpt4 key购买 nike

我想尝试来自 google ( https://developer.android.com/arch ) 的新生命周期内容,但在应用打开时崩溃。我所做的就是添加依赖项。还有其他人遇到这个问题吗?

日志:

FATAL EXCEPTION: main
Process: com.duetandroid.app.mock, PID: 17857
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/arch/lifecycle/LifecycleDispatcher;
at android.arch.lifecycle.LifecycleRuntimeTrojanProvider.onCreate(LifecycleRuntimeTrojanProvider.java:35)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726)
at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Caused by: java.lang.ClassNotFoundException: Didn't find class "android.arch.lifecycle.LifecycleDispatcher" on path: DexPathList[[zip file "/data/app/com.duetandroid.app.mock-1/base.apk"],nativeLibraryDirectories=[/data/app/com.duetandroid.app.mock-1/lib/x86, /data/app/com.duetandroid.app.mock-1/base.apk!/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.arch.lifecycle.LifecycleRuntimeTrojanProvider.onCreate(LifecycleRuntimeTrojanProvider.java:35) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1751) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:1726) 
at android.app.ActivityThread.installProvider(ActivityThread.java:5853) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384) 
at android.app.ActivityThread.-wrap2(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

build.gradle 依赖:

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:preference-v14:25.3.1'
compile 'com.google.guava:guava:20.0'
compile 'com.google.code.findbugs:annotations:3.0.1'
compile 'com.sylversky.fontreplacer:fontreplacer:1.0'
compile 'com.github.barteksc:android-pdf-viewer:2.5.1'
compile 'commons-io:commons-io:2.5'
compile 'com.github.angads25:filepicker:1.1.0'
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.google.firebase:firebase-crash:10.2.6'
compile 'android.arch.lifecycle:runtime:1.0.0-alpha1'
compile 'android.arch.lifecycle:extensions:1.0.0-alpha1'
annotationProcessor 'android.arch.lifecycle:compiler:1.0.0-alpha1'
compile 'android.arch.persistence.room:runtime:1.0.0-alpha1'
annotationProcessor 'android.arch.persistence.room:compiler:1.0.0-alpha1'

最佳答案

您使用 Proguard 吗?如果是这样,请尝试将其关闭:

debug {
minifyEnabled false
useProguard false
}

或者您可以将自定义规则添加到您的 Proguard 配置中:

-keep class android.arch.** { *; }

关于java - NoClassDefFoundError Landroid/arch/lifecycle/LifecycleDispatcher,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44075089/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com