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.

Crash when the app is force killed

See original GitHub issue

I’m trying out this library and it is often raising this exception when the app gets force killed:

FATAL EXCEPTION: main
Process: com.tattva.app, PID: 9136
java.lang.RuntimeException: java.lang.IllegalStateException: You need to call create() at least once to create the singleton
    at android.app.job.JobService$JobHandler.handleMessage(JobService.java:130)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5443)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
 Caused by: java.lang.IllegalStateException: You need to call create() at least once to create the singleton
    at com.evernote.android.job.JobManager.instance(JobManager.java:156)
    at com.evernote.android.job.JobProxy$Common.getPendingRequest(JobProxy.java:84)
    at com.evernote.android.job.v21.PlatformJobService.onStartJob(PlatformJobService.java:62)
    at android.app.job.JobService$JobHandler.handleMessage(JobService.java:126)
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5443) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 

The job gets scheduled inside my Application class so that it runs every time the app starts (after checking that the job isn’t already scheduled).

Update: I’m also seeing a constant stream of errors after killing the app:

E/JobServiceContext: Time-out while trying to bind com.tattva.app/com.evernote.android.job.v21.PlatformJobService jId=6, u0, dropping.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
vRallevcommented, Feb 15, 2016

You need to call JobManager.create() asap in the onCreate() method. The reason is that your app may be launched because of a scheduled job. This job needs to be initialized and for that purpose it needs the have access to the JobManager. In your case the manager isn’t created, yet, because you do this asynchronously.

0reactions
saeedjassanicommented, Dec 18, 2017

I am facing the same issue. But, I don’t have Application class hence using this link. Any solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do my apps keep crashing on Android, How to fix it
The easiest way to fix an app that keeps crashing on your Android smartphone is to simply force stop it and open it...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
Fix App Crashes on your Apple iPhone or Android smartphone. Kill the App; Restart the Phone; Update the App; Official Support; Use Bugfender!...
Read more >
[iOS] JSI crash when app is force killed / swiped out #32260
When the app is killed manually by a user (swiped out), or terminated by the OS due to inactivity, react native may randomly...
Read more >
Determine if the App is terminated by the User or by iOS
Hello Team,. How can I identify if an iOS app has been terminated by the User or by iOS? As per the documentation: ......
Read more >
How to crash an application to produce Crash Report
You just need to wait a couple of seconds if the application killed had big memory footprint, because it takes some time to...
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