Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Application Crashes in Emulator
    primarykey
    data
    text
    <p>My Android application crashes in the emulator with, with the following being output to the logs:</p> <pre><code>09-26 14:04:02.123: D/dalvikvm(716): GC_FOR_ALLOC freed 66K, 6% free 2675K/2844K, paused 29ms, total 30ms 09-26 14:04:02.123: I/dalvikvm-heap(716): Grow heap (frag case) to 3.455MB for 782224-byte allocation 09-26 14:04:02.173: D/dalvikvm(716): GC_FOR_ALLOC freed 2K, 5% free 3437K/3608K, paused 42ms, total 42ms 09-26 14:04:02.303: D/dalvikvm(716): GC_FOR_ALLOC freed &lt;1K, 5% free 3436K/3608K, paused 38ms, total 39ms 09-26 14:04:02.314: I/dalvikvm-heap(716): Grow heap (frag case) to 4.778MB for 1389712-byte allocation 09-26 14:04:02.363: D/dalvikvm(716): GC_FOR_ALLOC freed &lt;1K, 4% free 4793K/4968K, paused 52ms, total 52ms 09-26 14:04:02.423: D/AndroidRuntime(716): Shutting down VM 09-26 14:04:02.423: W/dalvikvm(716): threadid=1: thread exiting with uncaught exception (group=0x414c4700) 09-26 14:04:02.433: E/AndroidRuntime(716): FATAL EXCEPTION: main 09-26 14:04:02.433: E/AndroidRuntime(716): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sample_proj/com.example.sample_proj.MainActivity}: java.lang.NullPointerException 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.access$600(ActivityThread.java:141) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.os.Handler.dispatchMessage(Handler.java:99) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.os.Looper.loop(Looper.java:137) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.main(ActivityThread.java:5103) 09-26 14:04:02.433: E/AndroidRuntime(716): at java.lang.reflect.Method.invokeNative(Native Method) 09-26 14:04:02.433: E/AndroidRuntime(716): at java.lang.reflect.Method.invoke(Method.java:525) 09-26 14:04:02.433: E/AndroidRuntime(716): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 09-26 14:04:02.433: E/AndroidRuntime(716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 09-26 14:04:02.433: E/AndroidRuntime(716): at dalvik.system.NativeStart.main(Native Method) 09-26 14:04:02.433: E/AndroidRuntime(716): Caused by: java.lang.NullPointerException 09-26 14:04:02.433: E/AndroidRuntime(716): at com.example.sample_proj.MainActivity.onCreate(MainActivity.java:21) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.Activity.performCreate(Activity.java:5133) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175) 09-26 14:04:02.433: E/AndroidRuntime(716): ... 11 more </code></pre> <p>Would someone please help me in understanding why <code>NullPointerException</code> is being thrown and how I can resolve it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload