1

I am using react-native-firebase for one of my React Native project, Everything was working perfectly till today. Suddenly the app's push notification started acting weirdly.

ERROR

FATAL EXCEPTION: main
    Process: com.app, PID: 7389
    java.lang.AbstractMethodError: abstract method "com.google.android.gms.tasks.Task com.google.firebase.iid.WithinAppServiceBinder$IntentHandler.zza(android.content.Intent)"
        at com.google.firebase.iid.WithinAppServiceBinder.zza(com.google.firebase:firebase-iid@@20.2.2:9)
        at com.google.firebase.iid.zzaw.zza(com.google.firebase:firebase-iid@@20.2.2:30)
        at com.google.firebase.iid.zzaw.onServiceConnected(com.google.firebase:firebase-iid@@20.2.2:59)
        at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1948)
        at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1980)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 29
        targetSdkVersion = 29
        kotlinVersion = "1.3.72"
        googlePlayServicesVersion   = "16.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.0.0")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        classpath('com.google.gms:google-services:4.3.3')
    }
}

app/build.gradle

dependencies {
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation project(':react-native-push-notification')
    implementation 'com.google.firebase:firebase-analytics:17.4.2'
    implementation "com.google.firebase:firebase-core:17.4.3"
    implementation "com.google.firebase:firebase-messaging:20.2.2"

PS: React with firebase act weird.

Vijay Desai
  • 333
  • 1
  • 3
  • 7
  • I found the solution but it is not permanent. Temporary solution is: Inside react-native-push-notification/build.gradle change _20.2.1_ instead of _+_ on this line `implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '20.2.1')}"` – Vijay Desai Jul 08 '20 at 08:50
  • You can find a solution here: https://stackoverflow.com/questions/62767041/firebase-messaging-on-android-suddenly-started-crashing-when-message-received – Leg3nd Jul 08 '20 at 11:17
  • Thanks @Leg3nd but see the comment I already have checked that answer in above comment and it is a **temporary** solution. – Vijay Desai Jul 09 '20 at 02:58

0 Answers0