IllegalStateException Crashes

We should be maintaining that plugin as well. But that doesn’t mean Google isn’t changing something. What we need is to figure out if that’s the cause or not

Rob

OK - making that change in isolation to see if that’s the issue.

Have switched to Notifications v2 (which we are only using for local notifications) but now getting

Issue: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.XXX.XXX. Make sure to call FirebaseApp.initializeApp(Context) first.

Seems strange as the docs say we can do it without using Firebase if we’re not using it for Push https://docs.coronalabs.com/plugin/notifications-v2/registerForPushNotifications.html

We have the full log now. Is there a way I can share a log output with you @RobMiracle without exposing it publicly?

So the update is that I was able to build and get it to run with V2, but had to setup a Firebase app (even though it said we didn’t require it).

Will now deploy and see it it keeps getting the crash once live.

Deployed 24 hours ago and crashes are down 98% :slight_smile:

Will report back again in a few days, but at this stage it’s looking good.

Lessons are that Notifications v1 legacy is not longer working (despite docs saying legacy is supported) doc here: https://docs.coronalabs.com/plugin/notifications/index.html

Also Notifications v2 docs need updating (or the bug needs fixing) as it’s not possible to include it without a Firebase app setup (even with FCM set to false).

Doc is here: https://docs.coronalabs.com/plugin/notifications-v2/registerForPushNotifications.html

On iOS side, I had some problems too. I get these errors when I build my app:
 

Undefined symbols for architecture armv7: "\_deflate", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByCompressingBytes:length:compressionLevel:mode:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o) "\_deflateEnd", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByCompressingBytes:length:compressionLevel:mode:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o) "deflateInit2", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByCompressingBytes:length:compressionLevel:mode:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o) "\_inflate", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByInflatingBytes:length:isRawData:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o) "\_inflateEnd", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByInflatingBytes:length:isRawData:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o) "inflateInit2", referenced from: +[NSData(GTMZlibAdditionsPrivate) gtm\_dataByInflatingBytes:length:isRawData:error:] in libGoogleToolboxForMac.a(GTMNSData+zlib\_fc602038fcf7c84186e822a98cfdc996.o)

As additional information, I added these libraries to my Xcode project:
libFirebaseAnalytics,

libGoogleToolboxForMac
libFirebaseCore, libNotificationsV2Plugin
libFirebaseInstanceID, libProtobuf
libFirebaseMessaging

So we did that release and…  same problem.

Still getting lots of these:

java.lang.RuntimeException :

 

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

 

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:6940)

 

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 com.ansca.corona.SystemStartupBroadcastReceiver.onReceive (SystemStartupBroadcastReceiver.java:29)

 

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

This is with Notifications V2? Are you still running oneSignal?

I use pushwoosh, another bug is notification events received on Android 8+ but not shown on status bar.

Yes @robmiracle Notifications v2 (this is a change) and OneSignal (no changes on this front).

Also note that OneSignal notifications are getting through to the new build.

So OneSignal came back with…

"Are you only seeing this on Android 8+ devices? What Android API level are you targeting? This is the targetSdkVersion  in you build.gradle. Our current Corona SDK is only compatible with 25 and lower at this time. Lower it to 25 will allow your app to run on Android Oreo 8+ devices until we update our SDK.

We are looking to update our Corona SDK to match closer to our native Android SDK in an update next month which will allow targetSdkVersion 26+."

It is 8+ devices that we’re seeing with the problem. Question is how do we change the target version in the Corona build process @robmiracle ?

You can roll-back to the last version of Corona before we released support for API level 27. The last public build, 3326 is the first version where we switched from 25 to 27. However, we have fixed a lot of ANR and Android crash problems in builds since 3326. You may be trading one problem for a host of others.

Also, I know for certain you cannot submit new apps that don’t support 26+ and I’m pretty sure the window for updating apps with older versions has not passed. I don’t believe that Google will allow apps that don’t support 26+ any longer.

You are welcome to try to roll back to 3325 or earlier, but I’m not sure I would recommend that course of action.  My recommendations are:

  1. Wait on OneSignal’s update. I can’t even begin to guess when that will be. Keeping pressure on this may speed things up.

  2. Implement OneSignal’s REST-based system. I’m not familiar with the process, but I know other community developers have worked this out and you can search the forums on how to do this.

  3. Consider another provider.

Rob

@Rob Miracle I believe the java.lang.IllegalStateException is being thrown from com.ansca.corona.SystemStartupBroadcastReceiver.onReceive based on @beernathan stack trace. So this looks to be something from Corona itself or one of Corona’s Notification plugins, either V1 or V2.
 
The same stack trace was also reported by @zdmitrynsk on another thread;
https://forums.coronalabs.com/topic/72988-onesignal-with-targetsdkversion26-getting-error-background-start-not-allowed-service-intent-cmpcomonesignalgcmintentservicehas-extras/?p=390287
 
@karpovpw (Corona Staff) replied back with this update in Oct but no update since;
 

https://forums.coronalabs.com/topic/72988-onesignal-with-targetsdkversion26-getting-error-background-start-not-allowed-service-intent-cmpcomonesignalgcmintentservicehas-extras/?p=390616

Thanks.

Looks like it’s back to you @robmiracle

Hey @robmiracle - do you agree with the assessment from OneSignal?

Feel like we’re stuck between a rock & a hard place here.

It appears that you’re saying we can’t release an app right now that has both OneSignal and Notifications?

I’m checking…

Ping… this is still a big problem @robmiracle

This is now getting very frustrating. We re-coded to go to the OneSignal REST API (not the plugin) and re-released. We only have Notifications v2 now and we’re still getting this crash on android all the time (Corona 3326):

java.lang.RuntimeException :

 

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

 

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:6944)

 

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 com.ansca.corona.SystemStartupBroadcastReceiver.onReceive (SystemStartupBroadcastReceiver.java:29)

 

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

Ding