OneSignal with targetSdkVersion=26 getting error Background start not allowed: service Intent { cmp=***/com.onesignal.GcmIntentService(has extras) }

I’m investigating.

Any update?

hi, any update?

We are focused on rebuilding the Android build system which is required by Google. Hopefully, these issues can fall into place after that. This is a big project.

If you are pressed for time, perhaps you should use OneSignal’s REST api. Many people have used it successfully.

Rob

Thanks for the update… I think using REST api will not help as OneSignal Josh notices that this error comes from Corona notification plugin, so does not matter if it’s a rest or onesignal plugin.

If you will be able to fix it earlier it would be great as I am blocked for the past few months.

We moved to build 3462 and the problem went away. See https://forums.coronalabs.com/topic/74223-illegalstateexception-crashes/

Corona is still working on target version 26. I am actually surprised you got this far. They will notify us when it is ready for testing. Ignore all this if you are in some internal testing group that I am not aware of.

You cannot just select an SDK target with Corona. As @agramonte states, we are working on adding support for SDK version 26, but for now you should not be running apktool and making manual changes to your project.

Rob

OK i get it, so when you will add support to target version 26, then you will also fix OneSingal Plugin to support Android 8.0? Good to hear that you working on adding that support! 

@Rob: I know i shouldn’t make any manual changes in created .apk and i don’t do it. I was just curious what android:targetVersion is in .apk build by latest Corona Daily Build. My native project is working on old Corona version 2017.3079 so i wanted to check if newest daily build support version 26 already.

OneSignal maintains their own plugin. It will be up to them to update it after we enable SDK version 26.

Rob

@Rob. Good to know. Thank You very much for answering! So for now my topic is resolved. 

Will the warning from Google Play - that the App has to support SDK 28 in August - automatically disappear when I build with the new version of Corona SDK (when it appears) ?

Once we release support for that API level, if you rebuild your app, that warning should disappear.

Rob

We have encountered this and can’t see a way around it - has this bug seen any movement yet?

We have reached out to OneSignal to see if we can get an update. I’ll update here when I hear something. You probably should reach out to OneSignal as well.

Rob

Hi Rob, I have the same error of first post with onesignal plugin. The app crash if it’s on background and when receive a push from onesignal.

AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.onesignal.GcmBroadcastReceiver: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=xxx/com.onesignal.GcmIntentService (has extras) }: app is in background uid UidRecord{3ec248 u0a370 RCVR idle procs:1 seq(0,0,0)}

I have the latest version of corona sdk (daily build). The plugin is updated?

The OneSignal plugin is provided by OneSignal. It does not appear the plugin has been updated since January. We’ve reached out to them, but haven’t heard anything. Perhaps it would be more impactful if more community developers reached out to them to encourage them to update the plugin.

Rob

This is a serious disappointment. oneSignal’s Corona SDK plugin is causing a huge number of crashes and remains the most significant issue in our published app.

java.lang.IllegalStateException

com.onesignal.GcmBroadcastReceiver.processOrderBroadcast

Samsung Galaxy S8 (dreamlte), Android 8.0 (ONE OF MANY)

java.lang.RuntimeException :

at android.app.ActivityThread.handleReceiver (ActivityThread.java:3397)

at android.app.ActivityThread.-wrap18 (Unknown Source)

at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780)

at android.os.Handler.dispatchMessage (Handler.java:105)

at android.os.Looper.loop (Looper.java:164)

at android.app.ActivityThread.main (ActivityThread.java:6938)

at java.lang.reflect.Method.invoke (Native Method)

at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)

at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

Caused by: java.lang.IllegalStateException :

at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538)

at android.app.ContextImpl.startService (ContextImpl.java:1484)

at android.content.ContextWrapper.startService (ContextWrapper.java:663)

at android.content.ContextWrapper.startService (ContextWrapper.java:663)

at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:99)

at com.onesignal.GcmBroadcastReceiver.processOrderBroadcast (GcmBroadcastReceiver.java:76)

at com.onesignal.GcmBroadcastReceiver.onReceive (GcmBroadcastReceiver.java:59)

at android.app.ActivityThread.handleReceiver (ActivityThread.java:3390)

I just reached out to oneSignal via their online chat. The response I received was “back tomorrow”

I believe Corona’s 2018 update to its Notifications Plugin will provide the best alternative to avoid this problem: https://marketplace.coronalabs.com/corona-plugins/notifications

I’m working to implement it now.