无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication ?Android [英] Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication ?Android

查看:17
本文介绍了无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication ?Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 Android Studio 更新到了 2.0 版.但是我遇到了问题,不知道为什么?

重要的错误信息:

<块引用>

无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.eallcn.rentagent.MyDebugEallApplication

找了半天,没找到正确的答案你可以看到

库中的某个地方有什么问题吗?当 gradle 构建程序时,库没有为当前程序完全加载.Android Studio 2.0 版本有问题吗?

当我使用 Android studio 1.4.0 构建和运行程序时.这对我来说可以!但是当我使用Android Studio 2.0时,问题就出现了!

为什么?请帮帮我好吗?

这里是详细的错误日志:

<块引用>

11-28 11:57:00.489 19890-19890/com.eallcn.rentagent.debugE/AndroidRuntime:致命异常:主要进程:com.eallcn.rentagent.debug,PID:19890 java.lang.RuntimeException:无法实例化应用程序com.android.tools.fd.runtime.BootstrapApplication:java.lang.IllegalStateException: java.lang.ClassNotFoundException:com.eallcn.rentagent.MyDebugEallApplication在 android.app.LoadedApk.makeApplication(LoadedApk.java:537) 在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)在 android.app.ActivityThread.access$1800(ActivityThread.java:139)
在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
在 android.os.Handler.dispatchMessage(Handler.java:102)
在 android.os.Looper.loop(Looper.java:136)
在 android.app.ActivityThread.main(ActivityThread.java:5314)
在 java.lang.reflect.Method.invokeNative(Native Method)
在 java.lang.reflect.Method.invoke(Method.java:515)
在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
在 dalvik.system.NativeStart.main(Native Method)
引起:java.lang.IllegalStateException:java.lang.ClassNotFoundException:com.eallcn.rentagent.MyDebugEallApplication
在com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:167)在com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)在 android.app.Application.attach(Application.java:194)
在android.app.Instrumentation.newApplication(Instrumentation.java:992)
在android.app.Instrumentation.newApplication(Instrumentation.java:976)
在 android.app.LoadedApk.makeApplication(LoadedApk.java:532)
在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)在 android.app.ActivityThread.access$1800(ActivityThread.java:139)在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)在 android.os.Handler.dispatchMessage(Handler.java:102)在 android.os.Looper.loop(Looper.java:136)在 android.app.ActivityThread.main(ActivityThread.java:5314)在 java.lang.reflect.Method.invokeNative(Native Method)在 java.lang.reflect.Method.invoke(Method.java:515)在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)在 dalvik.system.NativeStart.main(本机方法)引起:java.lang.ClassNotFoundException:com.eallcn.rentagent.MyDebugEallApplication在 java.lang.Class.classForName(Native Method)在 java.lang.Class.forName(Class.java:251)在 java.lang.Class.forName(Class.java:216)在com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155)在com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)在 android.app.Application.attach(Application.java:194)在android.app.Instrumentation.newApplication(Instrumentation.java:992)在android.app.Instrumentation.newApplication(Instrumentation.java:976)在 android.app.LoadedApk.makeApplication(LoadedApk.java:532)在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)在 android.app.ActivityThread.access$1800(ActivityThread.java:139)在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)在 android.os.Handler.dispatchMessage(Handler.java:102)在 android.os.Looper.loop(Looper.java:136)在 android.app.ActivityThread.main(ActivityThread.java:5314)在 java.lang.reflect.Method.invokeNative(Native Method)在 java.lang.reflect.Method.invoke(Method.java:515)在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)在 dalvik.system.NativeStart.main(本机方法)引起:java.lang.NoClassDefFoundError:com/eallcn/rentagent/MyDebugEallApplication在 java.lang.Class.classForName(Native Method)在 java.lang.Class.forName(Class.java:251)在 java.lang.Class.forName(Class.java:216)在com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155)在com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)在 android.app.Application.attach(Application.java:194)在android.app.Instrumentation.newApplication(Instrumentation.java:992)在android.app.Instrumentation.newApplication(Instrumentation.java:976)在 android.app.LoadedApk.makeApplication(LoadedApk.java:532)在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)在 android.app.ActivityThread.access$1800(ActivityThread.java:139)在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)在 android.os.Handler.dispatchMessage(Handler.java:102)在 android.os.Looper.loop(Looper.java:136)在 android.app.ActivityThread.main(ActivityThread.java:5314)在 java.lang.reflect.Method.invokeNative(Native Method)在 java.lang.reflect.Method.invoke(Method.java:515)在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)在 dalvik.system.NativeStart.main(本机方法)引起:java.lang.ClassNotFoundException:没有找到类路径上的com.eallcn.rentagent.MyDebugEallApplication":DexPathList[[zip 文件"/data/app/com.eallcn.rentagent.debug-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.eallcn.rentagent.debug-1,/vendor/lib,/system/lib,/data/datalib]]在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)在 java.lang.ClassLoader.loadClass(ClassLoader.java:497)在 java.lang.ClassLoader.loadClass(ClassLoader.java:457)在 java.lang.Class.classForName(Native Method)在 java.lang.Class.forName(Class.java:251)在 java.lang.Class.forName(Class.java:216)在com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155)在com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)在 android.app.Application.attach(Application.java:194)在android.app.Instrumentation.newApplication(Instrumentation.java:992)在android.app.Instrumentation.newApplication(Instrumentation.java:976)在 android.app.LoadedApk.makeApplication(LoadedApk.java:532)在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)在 android.app.ActivityThread.access$1800(ActivityThread.java:139)在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)在 android.os.Handler.dispatchMessage(Handler.java:102)在 android.os.Looper.loop(Looper.java:136)在 android.app.ActivityThread.main(ActivityThread.java:5314)在 java.lang.reflect.Method.invokeNative(Native Method)在 java.lang.reflect.Method.invoke(Method.java:515)在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)在 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)在 dalvik.system.NativeStart.main(Native Method)

解决方案

禁用 Android Studio 中的 Instant Run 选项.说明位于 Android Studio Instant Run 文档中.

Instant Run 尝试对您的代码进行热交换;这会导致应用程序类被移动.

要禁用即时运行转到文件 --> 设置--> 构建、执行、部署 --> 即时运行 ---> 取消选中启用即时运行"

I updated my Android Studio to version 2.0. But I had a problem, I don't know why?

The important error info:

Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.eallcn.rentagent.MyDebugEallApplication

I searched a long time, But I didn't find the right answer you can see the link

At the same time when I click File->Project structure It shows this error:

Is there any problem somewhere in the libs? When gradle build the program the libs didn't load completely for current program. Is there any problem with Android Studio version 2.0?

When I use Android studio 1.4.0 to build and run the program. It works fine for me! But when I use the Android Studio 2.0, the problem shows up!

Why? Could you help me, please?

Here is detailed error log:

11-28 11:57:00.489 19890-19890/com.eallcn.rentagent.debug E/AndroidRuntime: FATAL EXCEPTION: main Process: com.eallcn.rentagent.debug, PID: 19890 java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.eallcn.rentagent.MyDebugEallApplication at android.app.LoadedApk.makeApplication(LoadedApk.java:537) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586) at android.app.ActivityThread.access$1800(ActivityThread.java:139)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5314)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.eallcn.rentagent.MyDebugEallApplication
at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:167) at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179) at android.app.Application.attach(Application.java:194)
at android.app.Instrumentation.newApplication(Instrumentation.java:992)
at android.app.Instrumentation.newApplication(Instrumentation.java:976)
at android.app.LoadedApk.makeApplication(LoadedApk.java:532)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)  at android.app.ActivityThread.access$1800(ActivityThread.java:139)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5314)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.ClassNotFoundException: com.eallcn.rentagent.MyDebugEallApplication at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:251) at java.lang.Class.forName(Class.java:216) at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155) at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)  at android.app.Application.attach(Application.java:194)  at android.app.Instrumentation.newApplication(Instrumentation.java:992)  at android.app.Instrumentation.newApplication(Instrumentation.java:976)  at android.app.LoadedApk.makeApplication(LoadedApk.java:532)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)  at android.app.ActivityThread.access$1800(ActivityThread.java:139)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5314)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NoClassDefFoundError: com/eallcn/rentagent/MyDebugEallApplication at java.lang.Class.classForName(Native Method)  at java.lang.Class.forName(Class.java:251)  at java.lang.Class.forName(Class.java:216)  at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155)  at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)  at android.app.Application.attach(Application.java:194)  at android.app.Instrumentation.newApplication(Instrumentation.java:992)  at android.app.Instrumentation.newApplication(Instrumentation.java:976)  at android.app.LoadedApk.makeApplication(LoadedApk.java:532)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)  at android.app.ActivityThread.access$1800(ActivityThread.java:139)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5314)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.eallcn.rentagent.MyDebugEallApplication" on path: DexPathList[[zip file "/data/app/com.eallcn.rentagent.debug-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.eallcn.rentagent.debug-1, /vendor/lib, /system/lib, /data/datalib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:497) at java.lang.ClassLoader.loadClass(ClassLoader.java:457) at java.lang.Class.classForName(Native Method)  at java.lang.Class.forName(Class.java:251)  at java.lang.Class.forName(Class.java:216)  at com.android.tools.fd.runtime.BootstrapApplication.createRealApplication(BootstrapApplication.java:155)  at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:179)  at android.app.Application.attach(Application.java:194)  at android.app.Instrumentation.newApplication(Instrumentation.java:992)  at android.app.Instrumentation.newApplication(Instrumentation.java:976)  at android.app.LoadedApk.makeApplication(LoadedApk.java:532)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4586)  at android.app.ActivityThread.access$1800(ActivityThread.java:139)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5314)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:680)  at dalvik.system.NativeStart.main(Native Method)

 

解决方案

Disable the Instant Run option in Android Studio. Instructions are in the Android Studio Instant Run documentation.

Instant Run tries to do hot swapping of your code; this causes the application class to be moved.

To disable Instant Run Go to File --> Settings--> Build,Execution,Deployment -->Instant Run ---> uncheck "Enable instant run"

这篇关于无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication ?Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆