android 调试崩溃Unable to instantiate application ***

更新后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***如图:android 调试崩溃Unable to instantiate application ***_第1张图片

关于Instant Run:是Android Studio2.0之后更新的一个强大的功能!在第一次运行之后,修改后的代码UI等不需要再build!可以快速再在真机上看到效果!节约生命!详情https://segmentfault.com/a/1190000004039742

你可能感兴趣的:(Android之迷之bug)