-2
    05-18 03:36:42.250: E/Trace(3525): error opening trace file: No such file or directory (2)
    05-18 03:36:42.640: D/AndroidRuntime(3525): Shutting down VM
    05-18 03:36:42.640: W/dalvikvm(3525): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
    05-18 03:36:42.732: E/AndroidRuntime(3525): FATAL EXCEPTION: main
    05-18 03:36:42.732: E/AndroidRuntime(3525): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.NullPointerException
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.ActivityThread.access$1300(ActivityThread.java:141)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.os.Handler.dispatchMessage(Handler.java:99)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.os.Looper.loop(Looper.java:137)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.ActivityThread.main(ActivityThread.java:5041)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at java.lang.reflect.Method.invokeNative(Native Method)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at java.lang.reflect.Method.invoke(Method.java:511)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at dalvik.system.NativeStart.main(Native Method)
    05-18 03:36:42.732: E/AndroidRuntime(3525): Caused by: java.lang.NullPointerException
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
    05-18 03:36:42.732: E/AndroidRuntime(3525):     ... 11 more
    05-18 03:36:56.010: D/gralloc_goldfish(3558): Emulator without GPU emulation detected.
    05-18 03:47:25.183: I/Choreographer(3558): Skipped 45 frames!  The application may be doing too much work on its main thread.
    05-18 03:47:39.080: D/gralloc_goldfish(3613): Emulator without GPU emulation detected.
    05-18 03:47:41.770: D/dalvikvm(3613): GC_CONCURRENT freed 84K, 7% free 2781K/2988K, paused 72ms+10ms, total 196ms
    05-18 03:47:41.770: D/dalvikvm(3613): WAIT_FOR_CONCURRENT_GC blocked 55ms
    05-18 03:47:45.579: D/dalvikvm(3613): GC_CONCURRENT freed 100K, 7% free 3083K/3300K, paused 5ms+20ms, total 226ms
    05-18 03:47:53.329: I/Choreographer(3613): Skipped 111 frames!  The application may be doing too much work on its main thread.

I know this is the second time I'm posting error messages, but please bear with me as I will eventually fully understand how to decipher these logs. But could someone help me understand why my log began with errors and then began to say that my emulation started to work?

SalTor
  • 23
  • 8

2 Answers2

5

What you've posted is a stack trace. It's a trace of what's happened most recently, and tracing back to what happened to get you there.

You need to read this in reverse. What happens at the top (the first line of what you posted) is what happened most recently.

Think of it like this:

I feel pain in my finger.
Just before that, my finger touched a hot burner.
Just before that, my hand stopped moving.
Just before that, my hand was moving down toward the burner.
Just before that, my hand was over the stove.
Just before that, my hand was just in front of the stove.
Just before that, my hand was near the stove.
Just before that, my hand was near my body.
Just before that, my hand was by my side.
Ken White
  • 123,280
  • 14
  • 225
  • 444
  • Very good explanation. Did you write that yourself? :) – acdcjunior May 18 '13 at 04:32
  • +1, for a good explanation ; ) – Emil Adz May 18 '13 at 04:34
  • 2
    @acdcjunior: Yes. I've burned my finger before. That's pretty much how it happened. :-) – Ken White May 18 '13 at 04:37
  • Hmm, that is definitely moving me in the right direction, thank you :) I also think http://stackoverflow.com/questions/9039017/android-app-application-cannot-be-instantiated-due-to-nullpointerexception this included a comment where someone had a solution that matched mine, namely that I had to make sure in the emulator I was on the home screen and the app wan't running on the phone. – SalTor May 18 '13 at 04:40
1

Your problem has nothing to do with the fact that the emulator started running, your problem is this line:

Caused by: java.lang.NullPointerException at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:379)

This means that somewhere in your code (as the error states: on line 379 if LoadedApk is you class) you are trying to access something that wasn't created first or it's creation failed and those it holds Null instead of an actual value or an Object.

Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • 1
    I don't think assigning null is how a null pointer exception works... – FDinoff May 18 '13 at 04:27
  • That doesn't make sense to me; none of my files are nearly that long (379 lines) – SalTor May 18 '13 at 04:30
  • -1 for two reasons. First, "somewhere in your code you are assigning null" is not how null pointer assignments happen. Second, you ignored the entire question being asked, which was the order of the entries in the stack trace (not the content of those entries). – Ken White May 18 '13 at 04:33
  • @KenWhite, I don't think that you are right about the second part, the OP question was: "could someone help me understand why my log began with errors and then began to say that my emulation started to work". I just pointed out that there is no connection between the second part of the stacktrace (the fact that the emulator started to run) and the actual exception. – Emil Adz May 18 '13 at 04:38
  • Ok. :-) The downvote for the first reason still remains despite your objection. `99.99999999%` (statistic invented, of course) of all null pointer exceptions are not caused by using `Null` in your code. (The same percentage **is** caused by trying to access something that wasn't created first or where creation failed, which is not the same as "somewhere you are assigning `Null`"). – Ken White May 18 '13 at 04:39
  • I re-edited the answer. Is this better? – Emil Adz May 18 '13 at 04:40
  • Better, but not quite there. :-) Look at the last sentence of my last comment, starting with "trying to access something". I'll remove my downvote, but you should consider rephrasing a little. – Ken White May 18 '13 at 04:49
  • second try, hope this better : ) English is not my mother tongue an some times it hard for me to explain my self especially in abstract topics like Null pointer exceptions , but in the end we are all here to help. – Emil Adz May 18 '13 at 04:54