安装apk时出错

时间:2014-12-10 17:26:51

标签: android eclipse

当我在模拟器或真实设备中运行我的java代码时,我偶尔会遇到此错误。然而,该应用程序继续安装良好。由于下面的错误出现在我的日食日志中的红色文本中,我被迫问。当我最终发布应用程序或者我应该忽略的东西时,它是否会导致严重问题?我的猜测是我可以使用try catch语句来捕获NullPointerException,但我不知道我的MainActivity中的哪个点产生了这个错误。

12-10 20:15:44.268: E/AndroidRuntime(1126): FATAL EXCEPTION: main
12-10 20:15:44.268: E/AndroidRuntime(1126): java.lang.RuntimeException: Unable to instantiate       application android.app.Application: java.lang.NullPointerException
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4124)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.ActivityThread.access$1300(ActivityThread.java:130)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.os.Looper.loop(Looper.java:137)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.ActivityThread.main(ActivityThread.java:4745)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at java.lang.reflect.Method.invokeNative(Native Method)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at java.lang.reflect.Method.invoke(Method.java:511)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at dalvik.system.NativeStart.main(Native Method)
12-10 20:15:44.268: E/AndroidRuntime(1126): Caused by: java.lang.NullPointerException
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:377)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:320)
12-10 20:15:44.268: E/AndroidRuntime(1126):     at android.app.LoadedApk.makeApplication(LoadedApk.java:493)
12-10 20:15:44.268: E/AndroidRuntime(1126):     ... 11 more

0 个答案:

没有答案