通过将divce与usb

时间:2016-08-10 06:22:37

标签: android nullpointerexception runtimeexception

每当安装和启动应用程序时,它都会出现异常。突然通过异常突然停止,我的崩溃

  

java.lang.RuntimeException:无法实例化应用程序com.android.tools.fd.runtime.BootstrapApplication:java.lang.NullPointerException                                                                                 在android.app.LoadedApk.makeApplication(LoadedApk.java:501)                                                                                 在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4255)                                                                                 在android.app.ActivityThread.access $ 1400(ActivityThread.java:140)                                                                                 在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1297)                                                                                 在android.os.Handler.dispatchMessage(Handler.java:99)                                                                                 在android.os.Looper.loop(Looper.java:174)                                                                                 在android.app.ActivityThread.main(ActivityThread.java:4952)                                                                                 at java.lang.reflect.Method.invokeNative(Native Method)                                                                                 在java.lang.reflect.Method.invoke(Method.java:511)                                                                                 在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1027)                                                                                 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)                                                                                 at dalvik.system.NativeStart.main(Native Method)                                                                              引起:java.lang.NullPointerException                                                                                 在android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)                                                                                 在android.app.LoadedApk.getClassLoader(LoadedApk.java:320)                                                                                 在android.app.LoadedApk.makeApplication(LoadedApk.java:493)                                                                                 在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4255)                                                                                 在android.app.ActivityThread.access $ 1400(ActivityThread.java:140)                                                                                 在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1297)                                                                                 在android.os.Handler.dispatchMessage(Handler.java:99)                                                                                 在android.os.Looper.loop(Looper.java:174)                                                                                 在android.app.ActivityThread.main(ActivityThread.java:4952)                                                                                 at java.lang.reflect.Method.invokeNative(Native Method)                                                                                 在java.lang.reflect.Method.invoke(Method.java:511)                                                                                 在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1027)                                                                                 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)                                                                                 在dalvik.system.NativeStart.main(本地方法)

为什么会抛出此异常?以及如何处理它。我是android世界的新手

1 个答案:

答案 0 :(得分:0)

在Android Studio中禁用“即时运行”选项。

Instant Run会尝试热插拔代码;这会导致应用程序类被移动。

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