React-native-push-notification: FATAL EXCEPTION: firebase-iid-executor

Created on 24 Dec 2020  路  9Comments  路  Source: zo0r/react-native-push-notification

Bug

Hello folks, thanks for this awesome lib! I'm getting a native issue from Android, can you help me please?

Environment info

react-native info output:

info Fetching system and libraries information...
System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 615.39 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 12.16.3 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmGlobalPackages:
    create-react-native-app: 1.0.0
    react-native-create-library: 3.1.2
    react-native-device-info: 0.22.4
    react-native-git-upgrade: 0.2.7
    react-native-inappbrowser-reborn: 3.4.0

Library version: 6.1.3

Steps To Reproduce

  1. Build Android application in release mode
  2. Open the app
    ...

Describe what you expected to happen:

  1. Open the app without crashing because a fatal exception
2020-12-24 12:32:59.304 12370-15927/? E/AndroidRuntime: FATAL EXCEPTION: firebase-iid-executor
    Process: com.myapp.prestaging, PID: 12370
    java.lang.NoClassDefFoundError: com.google.firebase.iid.Store$Token
        at com.google.firebase.iid.Store$Token.parse(com.google.firebase:firebase-iid@@21.0.1:1)
        at com.google.firebase.iid.Store.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
        at com.google.firebase.iid.FirebaseInstanceId.getTokenWithoutTriggeringSync(com.google.firebase:firebase-iid@@21.0.1:2)
        at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(Unknown Source:4)
        at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6)
        at com.google.android.gms.tasks.zzf.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.VerifyError: Verifier rejected class com.google.firebase.iid.Store$Token: com.google.firebase.iid.Store$Token com.google.firebase.iid.Store$Token.parse(java.lang.String) failed to verify: com.google.firebase.iid.Store$Token com.google.firebase.iid.Store$Token.parse(java.lang.String): [0x19] 'this' arg must be initialized (declaration of 'com.google.firebase.iid.Store$Token' appears in /data/app/com.myapp.prestaging-lSTMU8YPKpJVi39TnAEkIw==/base.apk!classes2.dex)
        at com.google.firebase.iid.Store$Token.parse(com.google.firebase:firebase-iid@@21.0.1:1)
        at com.google.firebase.iid.Store.getToken(com.google.firebase:firebase-iid@@21.0.1:1)
        at com.google.firebase.iid.FirebaseInstanceId.getTokenWithoutTriggeringSync(com.google.firebase:firebase-iid@@21.0.1:2)
        at com.google.firebase.iid.FirebaseInstanceId.getTokenWithoutTriggeringSync(com.google.firebase:firebase-iid@@21.0.1:1)
        at com.google.firebase.iid.FirebaseInstanceId.getToken(com.google.firebase:firebase-iid@@21.0.1:2)
        at com.google.firebase.messaging.FirebaseMessaging.lambda$new$0$FirebaseMessaging(Unknown Source:8)
        at com.google.firebase.messaging.FirebaseMessaging$$Lambda$0.run(Unknown Source:4)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6) 
        at java.lang.Thread.run(Thread.java:919) 

Thanks in advance and Merry Christmas! 馃巹

Best,
Juan

Most helpful comment

Hi,

Since it's only in release and Android, you should look in issues for "proguard", can't help more from my phone 馃槈

Merry Christmas 馃巵

Regards,

Hello @Dallas62
Do you know if this can be caused by expired certificates ?

All 9 comments

Hi,

Since it's only in release and Android, you should look in issues for "proguard", can't help more from my phone 馃槈

Merry Christmas 馃巵

Regards,

Thanks for your quickly response mate! 馃槉

We have Proguard disabled:

def enableProguardInReleaseBuilds = false
...
android {
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
        }
        releasePrestaging {
            applicationIdSuffix ".prestaging"
            matchingFallbacks = ['release', 'debug']
            minifyEnabled enableProguardInReleaseBuilds
        }
    }
}

Thanks for your help, my best wishes for you and your loved ones, merry Christmas and happy new year! <3

Also I can see some firebase packages like firebase.iid is now deprecated, more details here: https://firebase.google.com/support/release-notes/android#java

Hi,

Since it's only in release and Android, you should look in issues for "proguard", can't help more from my phone 馃槈

Merry Christmas 馃巵

Regards,

Hello @Dallas62
Do you know if this can be caused by expired certificates ?

Looks like google services are missing:

https://github.com/OneSignal/OneSignal-Unity-SDK/issues/271

mmm we already have classpath 'com.google.gms:google-services:4.3.3' from Android build.gradle of the project

And these dependencies:

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'com.google.firebase:firebase-analytics:18.0.0'
    implementation 'com.google.firebase:firebase-messaging:21.0.1'
    implementation 'com.google.firebase:firebase-iid' 
    implementation 'com.google.firebase:firebase-datatransport'
    implementation 'com.google.firebase:firebase-installations'
    implementation 'com.google.firebase:firebase-common'
    implementation 'com.google.firebase:firebase-installations-interop' 
    implementation 'com.google.firebase:firebase-iid-interop'
    implementation 'com.google.firebase:firebase-measurement-connector'
    implementation 'com.google.firebase:firebase-components'
    implementation 'com.google.firebase:firebase-encoders-json'
}

I don't understand what's missing here

Did you put this in android/app/build.gradle ?

apply plugin: 'com.google.gms.google-services'

Yes Sir 馃槄

Oh ok, it was fixed using these versions from android/build.gradle

buildscript {
    ext {
        firebaseIidVersion = "21.0.0"
        firebaseMessagingVersion = "21.0.0"
    }
}

Thanks for your help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NiuQiaoling picture NiuQiaoling  路  3Comments

DanDance picture DanDance  路  3Comments

ahmadallo1 picture ahmadallo1  路  3Comments

ssolida picture ssolida  路  3Comments

cookienawer picture cookienawer  路  3Comments