當運行一個Android應用程序時,我得到了這些錯誤,但是在設備上一切正常。那是什麼意思?以及如何擺脫它們?Android Logcat中的這些錯誤是什麼?我的應用程序工作正常,爲什麼這些錯誤?
07-20 11:09:38.119: E/AndroidRuntime(930): FATAL EXCEPTION: main
07-20 11:09:38.119: E/AndroidRuntime(930): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.LoadedApk.makeApplication(LoadedApk.java:482)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3909)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.ActivityThread.access$1300(ActivityThread.java:122)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1184)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.os.Handler.dispatchMessage(Handler.java:99)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.os.Looper.loop(Looper.java:137)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.ActivityThread.main(ActivityThread.java:4340)
07-20 11:09:38.119: E/AndroidRuntime(930): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 11:09:38.119: E/AndroidRuntime(930): at java.lang.reflect.Method.invoke(Method.java:511)
07-20 11:09:38.119: E/AndroidRuntime(930): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-20 11:09:38.119: E/AndroidRuntime(930): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-20 11:09:38.119: E/AndroidRuntime(930): at dalvik.system.NativeStart.main(Native Method)
07-20 11:09:38.119: E/AndroidRuntime(930): Caused by: java.lang.NullPointerException
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:362)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.LoadedApk.getClassLoader(LoadedApk.java:305)
07-20 11:09:38.119: E/AndroidRuntime(930): at android.app.LoadedApk.makeApplication(LoadedApk.java:474)
07-20 11:09:38.119: E/AndroidRuntime(930): ... 11 more
你的應用在致命異常後工作!!!? – 2012-07-20 09:33:33
是的!這就是爲什麼我想知道爲什麼所有這些錯誤出現!也許是超時?... – cleroo 2012-07-20 09:34:39
你可以檢查'line 362'在你的_LoadedApk.java_中引發了NullPointerException嗎? – Abhilasha 2012-07-20 09:36:21