React-native-onesignal: [3.2.7] Error Getting FCM Token java.io.IOException: AUTHENTICATION_FAILED

Created on 1 Nov 2018  ·  3Comments  ·  Source: OneSignal/react-native-onesignal

Description:

Searched the issues but couldn't find one with exactly my problem. Tried the solutions of similiar problems to no avail.
I installed react-native-onesignal but couldn't get any notifications. I'm using react-native-navigation v2 and in a previous project I had issues with onesignal because of react-native-navigation so maybe it has to do with this. And when I try to get pushToken with 'ids' listener, I get null.

Any help on identifying the root of the issue would be great.

Environment
react-native
0.55.4
react-native-onesignal
3.2.7
react-native-navigation
2.0.2581

  1. How did you add the SDK to your project (eg. npm)
    yarn add react-native-onesignal
    react-native link react-native-onesignal
    following installation instructions

Steps to Reproduce Issue:

  1. Install the OneSignal SDK and react-native-navigation
  2. Initialize the SDK after Navigation.events().registerAppLaunchedListener()
  3. Attempt to receive a push notification

Anything else:

I can't see device on Onesignal dashboard and getting these error messages in Logcat

10-31 22:30:21.384 5352-5420/com.bpm E/OneSignal: Error Getting FCM Token
    java.io.IOException: AUTHENTICATION_FAILED
        at com.google.firebase.iid.FirebaseInstanceId.zzb(Unknown Source:157)
        at com.google.firebase.iid.FirebaseInstanceId.getToken(Unknown Source:48)
        at com.onesignal.PushRegistratorFCM.getToken(PushRegistratorFCM.java:81)
        at com.onesignal.PushRegistratorAbstractGoogle.attemptRegistration(PushRegistratorAbstractGoogle.java:97)
        at com.onesignal.PushRegistratorAbstractGoogle.access$100(PushRegistratorAbstractGoogle.java:37)
        at com.onesignal.PushRegistratorAbstractGoogle$1.run(PushRegistratorAbstractGoogle.java:84)
        at java.lang.Thread.run(Thread.java:764)
10-31 22:30:22.329 5352-5428/com.bpm I/com.bpm: Rejecting re-init on previously-failed class java.lang.Class<com.onesignal.OneSignalChromeTab$OneSignalCustomTabsServiceConnection>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsServiceConnection;
        at void com.onesignal.OneSignalChromeTab.setup(android.content.Context, java.lang.String, java.lang.String, java.lang.String) (OneSignalChromeTab.java:46)
        at void com.onesignal.OneSignal$7.run() (OneSignal.java:1200)
        at void java.lang.Thread.run() (Thread.java:764)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.customtabs.CustomTabsServiceConnection" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/base.apk"],nativeLibraryDirectories=[/data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/lib/x86, /data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/base.apk!/lib/x86, /system/lib]]
        at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:126)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void com.onesignal.OneSignalChromeTab.setup(android.content.Context, java.lang.String, java.lang.String, java.lang.String) (OneSignalChromeTab.java:46)
        at void com.onesignal.OneSignal$7.run() (OneSignal.java:1200)
        at void java.lang.Thread.run() (Thread.java:764)
    Rejecting re-init on previously-failed class java.lang.Class<com.onesignal.OneSignalChromeTab$OneSignalCustomTabsServiceConnection>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/customtabs/CustomTabsServiceConnection;
        at void com.onesignal.OneSignalChromeTab.setup(android.content.Context, java.lang.String, java.lang.String, java.lang.String) (OneSignalChromeTab.java:46)
        at void com.onesignal.OneSignal$7.run() (OneSignal.java:1200)
        at void java.lang.Thread.run() (Thread.java:764)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.customtabs.CustomTabsServiceConnection" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/base.apk"],nativeLibraryDirectories=[/data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/lib/x86, /data/app/com.bpm-SGHIsxhAbT9yy0JD7NK5Vg==/base.apk!/lib/x86, /system/lib]]
10-31 22:30:22.330 5352-5428/com.bpm I/com.bpm:     at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:126)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void com.onesignal.OneSignalChromeTab.setup(android.content.Context, java.lang.String, java.lang.String, java.lang.String) (OneSignalChromeTab.java:46)
        at void com.onesignal.OneSignal$7.run() (OneSignal.java:1200)
        at void java.lang.Thread.run() (Thread.java:764)

Most helpful comment

@phantom1299 This is a general authentication error with Google's servers from the device. I recommend making sure you can sign into the Google Play Store on the device successfully and try again. I also recommend checking the version of the "Google Play services" app installed on the device.

See the follow issues for more details if the above did not help.
https://github.com/OneSignal/OneSignal-Android-SDK/issues/229
https://github.com/google/gcm/issues/97

All 3 comments

@phantom1299 This is a general authentication error with Google's servers from the device. I recommend making sure you can sign into the Google Play Store on the device successfully and try again. I also recommend checking the version of the "Google Play services" app installed on the device.

See the follow issues for more details if the above did not help.
https://github.com/OneSignal/OneSignal-Android-SDK/issues/229
https://github.com/google/gcm/issues/97

@jkasten2 That was indeed the issue. Tried it on my friends device and it worked. The problem was my test device. Thanks very much!

same issue here

Was this page helpful?
0 / 5 - 0 ratings