urbanairship / android-library

Urban Airship Android SDK
Other
112 stars 123 forks source link

IllegalStateException #38

Closed halysongoncalves closed 7 years ago

halysongoncalves commented 7 years ago

I'm getting this exception

Fatal Exception: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.urbanairship.push.ACTION_START_REGISTRATION cmp=br.com.mobits.cartolafc/com.urbanairship.AirshipService (has extras) }: app is in background uid UidRecord{bf26be6 u0a200 SVC idle procs:2 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1505) at android.app.ContextImpl.startService(ContextImpl.java:1461) at android.content.ContextWrapper.startService(ContextWrapper.java:644) at com.urbanairship.job.JobDispatcher.dispatch(JobDispatcher.java:63) at com.urbanairship.push.PushManager.init(PushManager.java:308) at com.urbanairship.UAirship.init(UAirship.java:591) at com.urbanairship.UAirship.executeTakeOff(UAirship.java:364) at com.urbanairship.UAirship.access$000(UAirship.java:44) at com.urbanairship.UAirship$2.run(UAirship.java:324) at java.lang.Thread.run(Thread.java:764)

rlepinski commented 7 years ago

Make sure you are actually running 8.9.4. We catch that exception when trying to start the service. https://github.com/urbanairship/android-library/blob/master/urbanairship-sdk/src/main/java/com/urbanairship/job/JobDispatcher.java#L109