question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JobStatus.getUid()' on a null object reference

See original GitHub issue

Not sure if actually an issue with this lib or maybe gcm.

Cant’t reproduce but seems to happen after JobManager.instance().cancelAllForTag. Up to now only appeared three times (2x Samsung 5.0, 1x Huawai 6.0) within the last week (having a few thousand active users per day).

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.android.server.job.controllers.JobStatus.getUid()' on a null object reference
       at android.os.Parcel.readException(Parcel.java:1552)
       at android.os.Parcel.readException(Parcel.java:1499)
       at android.app.job.IJobCallback$Stub$Proxy.jobFinished(IJobCallback.java:167)
       at android.app.job.JobService$JobHandler.handleMessage(JobService.java:147)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:135)
       at android.app.ActivityThread.main(ActivityThread.java:5910)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:31

github_iconTop GitHub Comments

10reactions
robelgadocommented, Jan 9, 2018

Seeing the same issue here

java.lang.NullPointerException: at android.os.Parcel.readException (Parcel.java:1552) at android.os.Parcel.readException (Parcel.java:1499) at android.app.job.IJobCallback$Stub$Proxy.jobFinished (IJobCallback.java:167) at android.app.job.JobService$JobHandler.handleMessage (JobService.java:147) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:135) at android.app.ActivityThread.main (ActivityThread.java:5422) at java.lang.reflect.Method.invoke (Native Method) at java.lang.reflect.Method.invoke (Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:914) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:707)

3reactions
ghostcommented, Jan 24, 2019

I did it as follows.

@Override
    public boolean onStartJob(JobParameters jobParameters) {
        // TODO Add your task
   
        // Should be protected to avoid crash in a device where call to jobId() results in NPE. Seems platform error
        try {
            jobFinished(jobParameters, true);
        } catch (NullPointerException ignored) {
        }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

android JobService异常Attempt to invoke virtual ... - 博客园
... Attempt to invoke virtual method 'int com.android.server.job.controllers.JobStatus.getUid()' on a null object reference at android.os.
Read more >
NullPointerException FirebaseUser.getUid()' on a null object ...
Root cause of the crash: firebaseauth.getinstance().getcurrentuser() is returns null So add a null check before accessing ...
Read more >
java.lang.NullPointerException: com.android.server.job ...
NullPointerException: Attempt to invoke virtual method 'int com.android.server.job.controllers.JobStatus.getUid()' on a null object reference at android.os.
Read more >
Developers - JobStatus.getUid()' on a null object reference -
Cant't reproduce but seems to happen after JobManager.instance().cancelAllForTag . Up to now only appeared three times (2x Samsung 5.0, 1x Huawai 6.0) within ......
Read more >
services/core/java/com/android/server/job/JobStore.java
if (ts.getUid() == uid && ts.getJobId() == jobId) {. return ts;. } } return null;. } /**. * @return The live array of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found