React-native-firebase: [馃悰] 馃敟 App or Analytics has a dependency on IID

Created on 20 Nov 2020  路  13Comments  路  Source: invertase/react-native-firebase

Issue

It seems that either App or Analytics is dependant on IID, I'm not sure since which version.

I upgraded from

"@react-native-firebase/analytics": "7.6.9",
"@react-native-firebase/app": "8.4.7",

to

"@react-native-firebase/analytics": "10.0.0",
"@react-native-firebase/app": "10.0.0",

My build fails completely with after the upgrade, with the following error

Corrupt serialized resolution result. Cannot find selected module (339) for constraint platform-runtime -> com.google.firebase:firebase-iid:21.0.0

To get it working, I had to install @react-native-firebase/iid (10.0.0).

react-native info output:

System:
    OS: macOS 11.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 509.85 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.8.0 - ~/.nvm/versions/node/v14.8.0/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v14.8.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK:
      API Levels: 23, 26, 28, 29, 30
      Build Tools: 23.0.1, 28.0.3, 29.0.2, 29.0.3, 30.0.0, 30.0.1
      System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: 22.0.6917172-beta1
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_181 - /usr/bin/javac
    Python: 2.7.15 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
  • Platform that you're experiencing the issue on:

    • [ ] iOS

    • [ ] Android

    • [ ] iOS but have not tested behavior on Android

    • [x] Android but have not tested behavior on iOS

    • [ ] Both

  • react-native-firebase version you're using that has this issue:

    • 10.0.0

  • Firebase module(s) you're using that has the issue:

    • App

    • Analytics

  • Are you using TypeScript?

    • Y: 4.0.5


Cheers

Needs Triage Bug Needs Repro User Issue

All 13 comments

I checked cd android && ./gradlew :app:dependencies and I don't see a dependency trace between iid and app or analytics.
Are you using the BoM dependency style?
It would help to see your android/build.gradle and android/app/build.gradle to see exactly what's going on there as I'm confused by the results I see so far

Hey @Johan-dutoit unfortunately I can't reproduce this.

I made a branch on my demo-skeleton builder script, with one commit hacking out all but app and analytics, while using BoM dependency style, and it worked. Then I second commit where I remove the BoM override and it is just app and analytics pure defaults, they both work?

https://github.com/mikehardy/rnfbdemo/commits/iid-triage

馃

Hi @mikehardy,

I missed mentioning this that this is with hermes engine (which I know isn't officially supported, but it's just App & Analytics. Which is also not relevant, as this is a build error on my side).

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "29.0.2"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 29
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:4.3.3'
        classpath('com.android.tools.build:gradle:4.1.0')

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

android/app/build.gradle (relevant parts only)

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

I created a new project with the same two dependencies and it worked just fine... 馃様
Perhaps it's not firebase requiring the IID 馃槺

Well I understand that is really frustrating, but at least I am not going crazy. Or if I am, it is not IID dependencies ;-)
./gradlew :app:dependencies > dependencies.txt then a nice cup of coffee and some inspection might help?
I'm going to close this as no repro though - obviously we'll re-open if it turns out it's RNFB here
Cheers @Johan-dutoit

Appreciate the effort, I'll keep testing and figuring out what's going on and report back if needed.
Thanks @mikehardy

@Johan-dutoit You're not alone! I'm having the same problem. But I found something interesting: I was using an older version of firebase-crashlytics-gradle than what the installation instructions for Crashlytics mentions. So I updated this line in my android/build-gradle:

-classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
+classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'

Now I get another error:

org.gradle.api.GradleException: Crashlytics could not determine stripped/unstripped native library directories for project ':app', variant Release. These are required for generating symbol files when NDK build tasks cannot be automatically inferred. Please specify strippedNativeLibsDir and unstrippedNativeLibsDir in the firebaseCrashlytics extension.

... so still not sure if I took a step back or forward. But I'll keep digging. :D

Btw I use ./gradlew lintVitalStaging --stacktrace to debug this.

EDIT: Seems like setting nativeSymbolUploadEnabled to false makes the app build 馃帀 . I might take a closer look at the NDK problem after updating all react-native-firebase deps to v10 (waiting for patch of remote-config).

@draperunner 2.4.1 is current for that dependency https://firebase.google.com/support/release-notes/android#crashlytics_gradle_plugin_v2-4-1 - and release notes indicate they have changed the native library stripped directives as of 2.2.0, interesting that's failing for you now

4253 has lots on the native symbol upload stuff - may not be useful to include even, so removing it may be the best path forward

I created a new project with the same two dependencies and it worked just fine... 馃様
Perhaps it's not firebase requiring the IID 馃槺

Was cycling through some old saved items and saw this becuase I had a vague memory but it finally came to me - as a note, react-native-device-info requires iid

I looked at IID for device info (as I do get notifications about device info) and thought it was that too. What stopped me from pursuing that, was that the error was only apparent when upgrading to Firebase V10.0.0, but worked fine before that (probably a red herring).

I have the same issue from upgrading to v10

Corrupt serialized resolution result. Cannot find selected module (342) for constraint platform-runtime -> com.google.firebase:firebase-iid:21.0.0

@aliceathens unfortunately we can't reproduce the problem with a clean install of react-native-firebase so I recommend checking the dependencies report from gradle as above

Was this page helpful?
0 / 5 - 0 ratings