react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

🔥Can't able to run react native android app with @react-native-firebase/perf": "19.1.0 and above

Open Chethana-KM opened this issue 9 months ago • 1 comments

Issue

Describe your issue here

I have tried integrating firebase packages with version >=19.0.0 in RN 0.71.18.But with all the versions, I'm ending up with the

below error :

Screenshot 2024-04-27 at 10 11 26 AM

Also find the below files which has following changes:

Project Files

  • Android: android/build.gradle contents. --> `buildscript { ext { kotlin_version = '1.8.0' kotlinVersion = '1.8.0' buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33 // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "23.1.7779620" supportLibVersion = "28.0.0" playServicesVersion = "18.0.0" androidMapsUtilsVersion = "0.5+" } repositories { google() jcenter() mavenCentral() maven { url 'https://maven.fabric.io/public' } // Configure the Maven repository address for the HMS Core SDK. /* maven { url 'https://developer.huawei.com/repo/' } */ } dependencies { classpath("com.android.tools.build:gradle:7.4.2") classpath("com.facebook.react:react-native-gradle-plugin") // Google services classpath 'com.google.gms:google-services:4.3.5'

    // Fabric tools // classpath 'io.fabric.tools:gradle:1.28.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version";

    // Add the AppGallery Connect plugin configuration. classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' classpath 'com.google.firebase:perf-plugin:1.4.2' //classpath 'com.huawei.agconnect:agcp:1.6.0.300' } } - Android:android/app/build.gradlecontents. -->dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android")

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")

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

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

implementation 'com.facebook.android:facebook-android-sdk:14.1.0'
implementation 'com.facebook.android:facebook-login:14.1.0'
// Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics:21.2.0'

//GIF
implementation 'com.facebook.fresco:fresco:2.0.0'
implementation 'com.facebook.fresco:animated-gif:2.0.0'
//For WebP support, including animated WebP
implementation 'com.facebook.fresco:animated-webp:1.10.0'
implementation 'com.facebook.fresco:webpsupport:1.10.0'

//MOE Integration Start
implementation "com.moengage:moe-android-sdk:12.10.03"
// implementation "com.huawei.hms:push:5.3.0.304"
// implementation 'com.huawei.agconnect:agconnect-core:1.5.0.300'
implementation("com.moengage:inbox-core:2.6.0")

// implementation("com.moengage:hms-pushkit:4.0.0")
implementation("com.moengage:rich-notification:4.7.2")
// Huawei dependency for Push Kit
// disabled as per Mo-Engage team mail
// implementation("com.huawei.hms:push:5.0.2.300")
// Push Amp dependancy added as per suggested
implementation ("com.moengage:push-amp:4.6.0")
// MoEngage In-app
implementation("com.moengage:inapp:7.1.3")

implementation("androidx.core:core:1.9.0")
implementation("androidx.appcompat:appcompat:1.4.2") {
  version {
    strictly '1.4.2'
  }
}
implementation("androidx.lifecycle:lifecycle-process:2.5.1")

implementation(platform("com.google.firebase:firebase-bom:32.8.0")) implementation 'com.google.firebase:firebase-messaging:23.1.2' // implementation 'com.google.firebase:firebase-inappmessaging:20.4.2' // implementation("com.google.firebase:firebase-perf") // implementation("com.google.firebase:firebase-perf") { // exclude group: 'com.google.firebase', module: 'firebase-sessions' // } // implementation("com.google.firebase:firebase-perf") { // exclude group: 'com.google.firebase', module: 'firebase-sessions' // }

//MOE Integration End

//TAG MANAGER
//implementation 'com.google.android.gms:play-services-tagmanager:17.0.0'
//implementation 'com.google.android.gms:play-services-analytics:17.0.0'

//Onesignal
implementation 'com.onesignal:OneSignal:4.8.3'
//GA integration
implementation 'com.google.android.gms:play-services-tagmanager:18.0.2'
implementation 'com.google.android.gms:play-services-analytics:18.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation 'com.google.firebase:firebase-appindexing:19.2.0' // App indexing
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation 'com.google.android.gms:play-services-ads:22.4.0'

//Glide library for image loading
implementation 'com.github.bumptech.glide:glide:4.11.0'
// Glide v4 uses this new annotation processor -- see https://bumptech.github.io/glide/doc/generatedapi.html
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

//LiveChat SDK
implementation 'com.github.livechat:chat-window-android:v2.0.3'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.10.0'
implementation('androidx.work:work-runtime:2.7.1')
implementation('androidx.work:work-runtime-ktx:2.7.1')
implementation (project(':react-native-camera')){
    exclude group: 'com.google.mlkit', module: 'face-detection'
}

` RN packages:

"@react-native-firebase/analytics": "19.1.0",
"@react-native-firebase/app": "19.1.0",
"@react-native-firebase/perf": "19.1.0",

Javascript

Click To Expand

package.json:

# N/A

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A

Android

Click To Expand

Have you converted to AndroidX?

  • [x] my application is an AndroidX application?
  • [x] I am using android/gradle.settings jetifier=true for Android compatibility?
  • [x ] I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • [x ] iOS
    • [ ] Android
    • [ x] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [ ] Both
  • react-native-firebase version you're using that has this issue:
    • 19.1.0
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y & ^4.8.4

Chethana-KM avatar Apr 27 '24 08:04 Chethana-KM

implementation 'com.google.firebase:firebase-appindexing:19.2.0' // App indexing

This is dangerous as a direct version specification. @react-native-firebase/app includes the firebase-bom which defines the versions we know are compatible within the com.google.firebase group, and you should not directly specify the versions in general

You don't mention what version of react-native you are on, but this looks like something in the gradle/android-gradle-plugin/google-services-plugin area.

I would make sure you are on current react-native, and make sure you are using current google-services plugin (4.4.1 https://firebase.google.com/support/release-notes/android)

I build from scratch all the time and it works, but it uses current versions: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

mikehardy avatar May 02 '24 16:05 mikehardy