I’ve been using onesignal for a few weeks and came across a problem. For some reason the onesignal init routine stopped working on Android. This happens on several devices.
After trying lots of changes, I finally determined that android permissions for location were causing the init to fail.
I proved this by taking the onesignal example app and inserting location permissions into it. Registering with onesignal failed.
Below is logcat output that points to the failure.
I get successful Google notification, but nothing else.
V/Corona ( 3755): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
V/Corona ( 3755): > Class.forName: OneSignal.LuaLoader
D/dalvikvm( 3755): GC_CONCURRENT freed 431K, 47% free 3194K/5959K, external 0K/512K, paused 7ms+10ms
V/Corona ( 3755): < Class.forName: OneSignal.LuaLoader
V/Corona ( 3755): Loading via reflection: OneSignal.LuaLoader
I/dalvikvm( 3755): Failed resolving Lcom/onesignal/ActivityLifecycleListener; interface 133 ‘Landroid/app/Application$ActivityLifecycleCallbacks;’
W/dalvikvm( 3755): Link of class ‘Lcom/onesignal/ActivityLifecycleListener;’ failed
E/dalvikvm( 3755): Could not find class ‘com.onesignal.ActivityLifecycleListener’, referenced from method com.onesignal.OneSignal.init
W/dalvikvm( 3755): VFY: unable to resolve new-instance 3448 (Lcom/onesignal/ActivityLifecycleListener;) in Lcom/onesignal/OneSignal;
D/dalvikvm( 3755): VFY: replacing opcode 0x22 at 0x0106
D/dalvikvm( 3755): VFY: dead code 0x0108-010d in Lcom/onesignal/OneSignal;.init (Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/onesignal/OneSignal$NotificationOpenedHandler;)V
D/NativeCrypto( 1542): returned from sslSelect() with result 1, error code 2
I/Corona ( 3755): Starting Corona OneSignal SDK v1.11.0
I/keystore( 1265): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/keystore( 1265): uid: 1000 action: e -> 7 state: 3 -> 3 retry: 4
I/dalvikvm( 3755): Could not find method android.app.Service.onTaskRemoved, referenced from method com.onesignal.SyncService.onTaskRemoved
W/dalvikvm( 3755): VFY: unable to resolve virtual method 652: Landroid/app/Service;.onTaskRemoved (Landroid/content/Intent;)V
D/dalvikvm( 3755): VFY: replacing opcode 0x6f at 0x0000
D/dalvikvm( 3755): VFY: dead code 0x0003-0006 in Lcom/onesignal/SyncService;.onTaskRemoved (Landroid/content/Intent;)V
W/System.err( 3755): java.lang.NullPointerException
W/System.err( 3755): at java.lang.reflect.Field.getField(Native Method)
W/System.err( 3755): at java.lang.reflect.Field.get(Field.java:237)
W/System.err( 3755): at com.onesignal.ActivityLifecycleListenerCompat.startListener(ActivityLifecycleListenerCompat.java:47)
W/System.err( 3755): at com.onesignal.OneSignal.init(OneSignal.java:295)
W/System.err( 3755): at OneSignal.LuaLoader$InitFunction.invoke(LuaLoader.java:115)