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

Stack Overflow | I.shL | 9 months ago
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

    creating geofences in background service

    Stack Overflow | 9 months ago | I.shL
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
  2. 0

    how to use context on PendingIntent in android service class?

    Stack Overflow | 1 month ago | hyunwookcho
    java.lang.RuntimeException: An error occurred while executing doInBackground()
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Exception Android Google Cloud messaging register

    Stack Overflow | 3 years ago | Flofloaud1034
    java.lang.RuntimeException: An error occured while executing doInBackground()
  5. 0

    Android push with new Google Cloud Messaging

    Stack Overflow | 3 years ago | Flofloaud1034
    java.lang.RuntimeException: An error occured while executing doInBackground()

    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.NullPointerException

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

      at android.app.PendingIntent.getBroadcastAsUser()
    2. Android Platform
      PendingIntent.getBroadcast
      1. android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:506)
      2. android.app.PendingIntent.getBroadcast(PendingIntent.java:495)
      2 frames
    3. com.example.android
      GPSPollingService.onConnected
      1. com.example.android.safetyalert.GPSPollingService.createRequestPendingIntent(GPSPollingService.java:449)
      2. com.example.android.safetyalert.GPSPollingService.continueAddGeofences(GPSPollingService.java:369)
      3. com.example.android.safetyalert.GPSPollingService.onConnected(GPSPollingService.java:163)
      3 frames
    4. com.google.android
      zzd$zzd.handleMessage
      1. com.google.android.gms.common.internal.zzl.zzm(Unknown Source)
      2. com.google.android.gms.internal.zzof.zzk(Unknown Source)
      3. com.google.android.gms.internal.zzod.zzsb(Unknown Source)
      4. com.google.android.gms.internal.zzod.onConnected(Unknown Source)
      5. com.google.android.gms.internal.zzoh.onConnected(Unknown Source)
      6. com.google.android.gms.internal.zznw.onConnected(Unknown Source)
      7. com.google.android.gms.common.internal.zzk$1.onConnected(Unknown Source)
      8. com.google.android.gms.common.internal.zzd$zzj.zztp(Unknown Source)
      9. com.google.android.gms.common.internal.zzd$zza.zzc(Unknown Source)
      10. com.google.android.gms.common.internal.zzd$zza.zzw(Unknown Source)
      11. com.google.android.gms.common.internal.zzd$zze.zztr(Unknown Source)
      12. com.google.android.gms.common.internal.zzd$zzd.handleMessage(Unknown Source)
      12 frames
    5. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:102)
      2. android.os.Looper.loop(Looper.java:135)
      3. android.app.ActivityThread.main(ActivityThread.java:5312)
      3 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
      2 frames