java.lang.NullPointerException

Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web71

  • via Stack Overflow by BabiSter
    ,
  • Stack trace

    • java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference at android.preference.PreferenceManager.getDefaultSharedPreferencesName(PreferenceManager.java:375) at android.preference.PreferenceManager.getDefaultSharedPreferences(PreferenceManager.java:370) at com.sovraan.GCMPushReceiverService.onMessageReceived(GCMPushReceiverService.java:30) at com.google.android.gms.gcm.GcmListenerService.zzq(Unknown Source) at com.google.android.gms.gcm.GcmListenerService.zzp(Unknown Source) at com.google.android.gms.gcm.GcmListenerService.zzo(Unknown Source) at com.google.android.gms.gcm.GcmListenerService.zza(Unknown Source) at com.google.android.gms.gcm.GcmListenerService$1.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Indri YunitaIndri Yunita
    4 times, last one
    ivotje50ivotje50
    2 times, last one
    joni1408joni1408
    Once,
    Mihail MelnicMihail Melnic
    2 times, last one
    8 more bugmates