Repository: zo0r/react-native-push-notification

Issue #171: Google Repository v32 breaks
Created: 2016-08-24T01:16:54Z
When upgrading Google Repository in Android SDK from v28 to v32, the compiled apk no longer runs:
The application will either redbox on debug build, or crash on production build
Fatal Exception: com.facebook.react.modules.core.JavascriptException: C++ Exception in 'nativeRequireModuleConfig': java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/app/redacted/base.apk), stack:
get@57:538
<unknown>@470:52
o@2:517
e@2:326
i@2:188
<unknown>@469:209
o@2:517
e@2:326
i@2:188
<unknown>@427:517
o@2:517
e@2:326
i@2:188
<unknown>@374:223
o@2:517
e@2:326
i@2:188
<unknown>@12:88
o@2:517
e@2:256
i@2:188
global code@639:9

       at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:94)
       at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:78)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:319)
       at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:139)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback(Handler.java:739)
       at android.os.Handler.dispatchMessage(Handler.java:95)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
       at android.os.Looper.loop(Looper.java:148)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
       at java.lang.Thread.run(Thread.java:818)

Devices tested: Genymotion, Nexus 4, Nexus 4, Note 5 running Android 6.0
The application tested was configured correctly (it works completely fine until the repository was updated).
Dependency:
    compile ('com.google.android.gms:play-services-gcm:8.4.0') {
        force = true;
    }
It seems that this issue is fixed in Play Services v9.0

Duplicate issue #144: Unfortunately, application has stopped
Created: 2016-07-14T11:39:02Z
My app crashes when setting the sender_id field for android.
The error I am getting is:
E/AndroidRuntime( 6114): FATAL EXCEPTION: IntentService[RNPushNotification]
E/AndroidRuntime( 6114): Process: com.privpro, PID: 6114
E/AndroidRuntime( 6114): java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
E/AndroidRuntime( 6114):    at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
E/AndroidRuntime( 6114):    at com.google.android.gms.iid.zzd.(Unknown Source)
E/AndroidRuntime( 6114):    at com.google.android.gms.iid.zzd.(Unknown Source)
E/AndroidRuntime( 6114):    at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
E/AndroidRuntime( 6114):    at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
E/AndroidRuntime( 6114):    at com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService.onHandleIntent(RNPushNotificationRegistrationService.java:20)
E/AndroidRuntime( 6114):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
E/AndroidRuntime( 6114):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 6114):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 6114):    at android.os.HandlerThread.run(HandlerThread.java:61)

Closing comment (2017-03-16T00:29:23Z): Just in case people find this issue first when searching for this problem: I would say it's more related to #171 . I had Google Repository installed, but v44, because that's the only one my Android Studio version shows me. So then I found about #171 and I tried updating the google play services dependencies as they suggest there (from a failing 8.1.0 to 9.4.0) and now it works.