java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ricky.comenchat/com.example.ricky.comenchat.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference

tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    PreferenceManager.getDefaultSharedPreferences(getContext()) is null

    Stack Overflow | 8 months ago | Im_Just_A_Beginner
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.ricky.comenchat/com.example.ricky.comenchat.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
  2. 0

    Release apk crashes but debug runs fine

    Stack Overflow | 1 year ago | VaibhaV Deshmukh
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pttest.com.pockettankstips/com.pttest.com.pockettankstips.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void android.support.v7.internal.widget.v.setWindowCallback(android.view.Window$Callback)' on a null object reference
  3. 0

    GitHub comment 5354#173029671

    GitHub | 1 year ago | samueltardieu
    java.lang.RuntimeException: Unable to start activity ComponentInfo{cgeo.geocaching/cgeo.geocaching.maps.mapsforge.v6.NewMap}: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Why am I getting null pointer execepiton while finding a view of a fragment by ID?

    Stack Overflow | 1 year ago | Abhishek Prakash
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.dhruv.parqueue/com.example.dhruv.parqueue.UserProfile}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.app.Dialog.findViewById(int)' on a null object reference
  6. 0

    Java Error: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

    Stack Overflow | 1 year ago | Mich ael
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.michael1011.tweetcomposer/com.michael1011.tweetcomposer.login}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

  1. Hiren 2 times, last 6 days ago
  2. poroszd 1 times, last 1 week ago
  3. Indri Yunita 7 times, last 3 months ago
  4. andreeaa marin 184 times, last 4 months ago
  5. Reich 62 times, last 5 days ago
44 more registered users
15 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.RuntimeException

    Unable to start activity ComponentInfo{com.example.ricky.comenchat/com.example.ricky.comenchat.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference

    at android.app.ActivityThread.performLaunchActivity()
  2. Android Platform
    ActivityThread.handleLaunchActivity
    1. android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
    2. android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2520)
    2 frames