gpt4 book ai didi

android - 无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication ?Android

转载 作者:行者123 更新时间:2023-12-02 09:51:16 26 4
gpt4 key购买 nike

我将我的 Android Studio 更新到了 2.0 版。但是我有一个问题,我不知道为什么?

重要的错误信息:

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



找了很久,没有找到正确的答案
你可以看到 link

同时点击 文件->项目结构
它显示了这个错误:

enter image description here

库中的某个地方有什么问题吗?当 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.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)



最佳答案

在 Android Studio 中禁用 Instant Run 选项。说明在 Android Studio Instant Run documentation .

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

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

关于android - 无法实例化应用程序 com.android.tools.fd.runtime.BootstrapApplication ?Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33967703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com