Closed7
android-room-with-a-view-kotlin を流す
https://developer.android.com/codelabs/android-room-with-a-view-kotlin これを最後まで流したけど、エラーで動かない
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.tktcorporation.roomwithaview, PID: 13629
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tktcorporation.roomwithaview/com.tktcorporation.roomwithaview.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.tktcorporation.roomwithaview.MainActivity" on path: DexPathList[[zip file "/data/app/~~tOGVruhjwh79fy_WuOwELg==/com.tktcorporation.roomwithaview-UtOwl0dNu8K4wJktEaHTqA==/base.apk"],nativeLibraryDirectories=[/data/app/~~tOGVruhjwh79fy_WuOwELg==/com.tktcorporation.roomwithaview-UtOwl0dNu8K4wJktEaHTqA==/lib/arm64, /system/lib64, /system_ext/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3365)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tktcorporation.roomwithaview.MainActivity" on path: DexPathList[[zip file "/data/app/~~tOGVruhjwh79fy_WuOwELg==/com.tktcorporation.roomwithaview-UtOwl0dNu8K4wJktEaHTqA==/base.apk"],nativeLibraryDirectories=[/data/app/~~tOGVruhjwh79fy_WuOwELg==/com.tktcorporation.roomwithaview-UtOwl0dNu8K4wJktEaHTqA==/lib/arm64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1253)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3353)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
これはもしかすると、MainActivity
にパッケージの宣言がなかったのかも?
一旦 pull してきて、差分取ってみようかな
リポジトリはここ
差分取って何やかんやしてたら動いた
動かなかったときとの差分はこれ動いたコード
検証機は
- Pixel4
- AndroidVersion: 11
このスクラップは2020/12/23にクローズされました