私は新しいライフサイクルのものをGoogle(https://developer.android.com/arch)から試してみたいと思っていますが、アプリがクラッシュしてしまいました。私がしたのは、依存関係を追加することだけでした。他の誰かがこの問題を抱えていますか?NoClassDefFoundError Landroid/arch/lifecycle/LifecycleDispatcher
LOG:
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'
はhttps://stackoverflow.com/a/41479463/2914140を参照してください。 – CoolMind