android 调试崩溃Unable to instantiate application的解决方法
程序员文章站
2023-11-30 14:44:46
更新后android 调试app崩溃!unable to instantiate application ***
e/androidruntime: fatal exception: main...
更新后android 调试app崩溃!unable to instantiate application ***
e/androidruntime: fatal exception: main process: com.***.plants, pid: 23100 java.lang.runtimeexception: unable to instantiate application com.***.myapplication: java.lang.classnotfoundexception: didn't find class "com.****.myapplication" on path: dexpathlist[[zip file "/data/app/com.****.plants-1/base.apk"],nativelibrarydirectories=[/data/app/com.***.plants-1/lib/arm64, /system/fake-libs64, /data/app/com.***.plants-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] at android.app.loadedapk.makeapplication(loadedapk.java:853) at android.app.activitythread.handlebindapplication(activitythread.java:5681) *** caused by: java.lang.classnotfoundexception: didn't find class "com.***.myapplication" on path: dexpathlist[[zip file "/data/app/com.****.plants-1/base.apk"],nativelibrarydirectories=[/data/app/com.***.plants-1/lib/arm64, /system/fake-libs64, /data/app/com.***.plants-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] ***
问题原因:耗尽元气最后得出:不详,可能由于机型原因,模拟器没有问题,可能由于as版本问题,笔者as3.0。
改为低版本的gradle并不推荐:
解决方法:
打开设置:file->settings,搜索instant run,取消勾选enable?instant run to***如图:
关于instant run:是android studio2.0之后更新的一个强大的功能!在第一次运行之后,修改后的代码ui等不需要再build!可以快速再在真机上看到效果!节约生命