skip to Main Content

app BUILD FAILED after i install @react-native-firebase/app

package.json

    "@react-native-firebase/app": "^18.0.0",
    "react-native": "0.70.0",

this is my build.gradle


    implementation project(':react-native-pusher-push-notifications') 
    implementation 'com.pusher:push-notifications-android:1.9.0'

        implementation ("com.google.firebase:firebase-iid:21.1.0")
    implementation ("com.google.firebase:firebase-messaging:23.0.0")
      implementation 'androidx.multidex:multidex:2.0.1'  // <-- ADD THIS DEPENDENCY
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.android.gms.internal.measurement.zzdu found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzdv found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzdw found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzdx found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzdy found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzdz found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzea found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-impl:16.1.1) and jetified-play-services-measurement-sdk-api-21.3.0-runtime (com.google.android.gms:play-services-measurement-sdk-api:21.3.0)
     Duplicate class com.google.android.gms.internal.measurement.zzeb found in modules jetified-firebase-analytics-impl-16.1.1-runtime (com.google.firebase:firebase-analytics-

2

Answers


  1. Chosen as BEST ANSWER

    i found the problem

    with this package "react-native-pusher-push-notifications": "^2.5.2",

    so what i do is install an older version from firebase

    so i replace this "@react-native-firebase/app": "^18.0.0", with "@react-native-firebase/app": "^14.12.0",

    and now everything is working fine


  2. android / app / build.gradle

    add this

    def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
    
    allprojects {
        configurations.all {
            resolutionStrategy {
                // Remove this override in 0.65+, as a proper fix is included in react-native itself.
                force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
            }
        }
         repositories {
            google()
            mavenLocal()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url("$rootDir/../node_modules/react-native/android")
            }
            maven { // <---- Add this block
                url 'https://github.com/jitsi/jitsi-maven-repository/raw/master/releases'
            }
            maven {
                // Android JSC is installed from npm
                url("$rootDir/../node_modules/jsc-android/dist")
            }
    
            jcenter()
            maven { url 'https://www.jitpack.io' }
            maven {
                url 'https://maven.google.com'
            }
        }
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search