Showstopper (crash) with Onesignal plugin and GPS on Android 6.x

Hi,

We are facing a showstopper on android 6.x (Marshmallow) as our app is quitting with the message “Unfortunately testApp has stopped”.

It is working on all other version of Android.

We have attached the sample code to easily reproduce the bug.

When using a GPS event handler on our code with the one signal plugin, it will automatically crash at startup. If we remove the onesignal plugin it will work perfectly. Again, only on Android 6.x

Please help as we will need to change our message notification provider if this cannot be fixed quickly.

regards,

Nick

Nick,

Could you let us know the Corona build version you are using and send attach the full stack trace and exception that shows in the device’s logcat? 

Thanks.

This is using the latest public version of Corona.

here is the stack trace we were able to get

java.lang.NullPointerException: storage == null
    at java.util.Arrays$ArrayList.(Arrays.java:38)
    at java.util.Arrays.asList(Arrays.java:155)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:76)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:71)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:67)
    at com.ansca.corona.CoronaSensorManager$1.run(CoronaSensorManager.java:259)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

But if you build the sample, I have provided, you will be able to repro

Thanks, looks to be internal crash in Corona but I’ll try out your project with build 2906 to see what other details I can find.

Maybe a hint to help you, is that with the new android 6.x there is now a dialog that is displayed to accept the gps location. Maybe this is where the conflict is. Because, by removing the plugin from the build settings, everything is working well.

Of course, always do a clean install everytime to reproduce as this happen during the GPS localisation authorization.

@nmichaud

I am able to reproduce the crash however I was not able find a work around. The crash is definitely happening in Corona’s PermissionsSettings class. The app only crashes when you build with OneSignal as it adds extra permissions that is triggering a bug in Corona’s code.

Can you try an older build of Corona?

@Rob Miracle

Could you have some one look at PermissionsSettings.java with the exception noted above in the Corona source? It seems the string[] array being passed to it isn’t formatted correctly.

I’ll need a bug report filed please. It will need a small app that demonstrates the problem. Zip up the main.lua, config.lua and build.settings used and any assets, and use the “Report a bug” link at the top of the page.

You will get an email with the CaseID in it. Post it back here and I’ll see if I can get someone to look at it.

Rob

A bug have been submitted with the same sampleApp I put initially in this thread to reproduce the bug. The case ID  46616

You should have gotten an email confirming the bug submission. The CaseID is in the subject of that message.

It looks like its case 46616.

Rob

Hi receive this from this answer from the ticket I have opened. Frankly, I do not know what to do as OneSignal already did an investigation pointing to Corona and Corona says talk to the plugin owner!

Hello, Unfortunately OneSignal is a third parity plugin so you will need to contact the developer and have them resolve the issue. We don't have access to their code so we can't debug the issue. Regard,

Let me see what I can find out…

They re-looked at the issue and if I followed things correctly, we’ve made a change to address an edge case. The changes should be in the next daily build at which I’m assuming Josh will need to update the plugin. I don’t know when we will resume daily builds. We usually wait a week or so after a public build release (happened on Monday).

Rob

@Rob Miracle Thanks for the fix!

Sounds like the OneSignal plugin should work fine after the next daily build. Let me know there is a compatibility change I can make for older builds or what triggered the bug.

@Rob, thank you for the fix. We will try it as soon as the new daily build is available.

Just to be clear, the new daily build of Corona SDK won’t help you. The changes are in Enterprise and Josh will need to rebuild and upload a new plugin. After that you’re good to go.

Rob

@nmichaud Just push version 1.13.2 of the OneSignal SDK to fix the crash on current builds of Corona. It should be available in a few hours. This fully disables Android badges, we will bring it back in a future release for newer builds of Corona.

Nick,

Could you let us know the Corona build version you are using and send attach the full stack trace and exception that shows in the device’s logcat? 

Thanks.

This is using the latest public version of Corona.

here is the stack trace we were able to get

java.lang.NullPointerException: storage == null
    at java.util.Arrays$ArrayList.(Arrays.java:38)
    at java.util.Arrays.asList(Arrays.java:155)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:76)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:71)
    at com.ansca.corona.permissions.PermissionsSettings.(PermissionsSettings.java:67)
    at com.ansca.corona.CoronaSensorManager$1.run(CoronaSensorManager.java:259)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:158)
    at android.app.ActivityThread.main(ActivityThread.java:7229)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

But if you build the sample, I have provided, you will be able to repro

Thanks, looks to be internal crash in Corona but I’ll try out your project with build 2906 to see what other details I can find.

Maybe a hint to help you, is that with the new android 6.x there is now a dialog that is displayed to accept the gps location. Maybe this is where the conflict is. Because, by removing the plugin from the build settings, everything is working well.

Of course, always do a clean install everytime to reproduce as this happen during the GPS localisation authorization.