0

When i run my java code in the emulator or the real device, i every once in a while get this error. However, the app goes on and installs well. Since the error below appears in red text in my eclipse log, i have been forced to ask.. Is it an error that can cause significant problems when i release the app eventually or its something i should ignore? My guess is that i can use a try catch statement to capture the NullPointerException but i have no clue at what point in my MainActivity this error is generated.

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
user3267567
  • 524
  • 4
  • 14
  • http://stackoverflow.com/questions/9746116/exception-when-i-run-my-application-from-eclipse – zgc7009 Dec 10 '14 at 17:32
  • Make sure that you have "registered" the activity in the Android Manifest file. Do you have multiple activities in this app, if so, this might be one explanation as to why one of the activities cannot be instantiated but the app continues to run. Is the activity that crashed the activity for startup, or is it one of the activities that occurs later on in the app? – AeroVTP Dec 10 '14 at 17:39
  • please post your androidmanifest.xml – Jorgesys Dec 10 '14 at 18:19
  • this error happens when i click the green [RUN] button in eclipse but before the first activity gets displayed. Once the first activity is displayed, the app behaves normally with no errors. – user3267567 Dec 10 '14 at 21:28
  • It happens between the time when i click the green [RUN] button in eclipse and before the first activity gets displayed. After that, the app behaves normally with no errors. i tried pasting the manifest file but its too long. – user3267567 Dec 10 '14 at 21:35

0 Answers0