React-native-firebase: [馃悰] Bug Report Title - 谋 take Fix dependency resolution errors

Created on 23 Oct 2020  路  3Comments  路  Source: invertase/react-native-firebase

I am using react-native-camera with mlkit and 谋 take Fix dependency resolution errors when 谋 install @react-native-firebase/app

"react-native": "0.62.2"
"@react-native-firebase/app": "^8.4.6",
"react-native-camera": "^3.40.0",

/build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 21
        compileSdkVersion = 28
        targetSdkVersion = 29

        pdfViewer = "3.1.0-beta.1"

    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
        classpath("com.google.gms:google-services:4.3.3")

        // 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' }
    }
}

app/build.gradle

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

    implementation platform('com.google.firebase:firebase-bom:25.12.0')
    implementation 'com.google.firebase:firebase-analytics'

    implementation 'com.google.android.gms:play-services-vision:20.0.0'

    implementation 'com.google.firebase:firebase-ml-vision:24.0.3'



    implementation 'com.google.android.gms:play-services-analytics:17.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'
    }

    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
    }
}

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.vision.zzbl found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzbn found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzbo found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzbp found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzbr found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zze found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzf found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzg found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzh found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzi found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzkf found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzkh found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzki found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzkj found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzkl found in modules jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0) and jetified-play-services-vision-face-contour-internal-16.0.0-runtime (com.google.android.gms:play-services-vision-face-contour-internal:16.0.0)
Duplicate class com.google.android.gms.internal.vision.zzv found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)
Duplicate class com.google.android.gms.internal.vision.zzw found in modules jetified-play-services-vision-20.0.0-runtime (com.google.android.gms:play-services-vision:20.0.0) and jetified-play-services-vision-common-19.1.0-runtime (com.google.android.gms:play-services-vision-common:19.1.0)

 Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>

```.

Needs Triage Bug

Most helpful comment

This is an upstream issue, firebase team blew up their own dependencies

You likely need these or some other way to untangle them

https://github.com/invertase/react-native-firebase/commit/dc4f57a952a7076a48a224087c9a8e7cdeaf4afc#diff-8a85188c69631f3ee1d3b09e01cdfcffae515432e9efdfb74683b880a8902172

All 3 comments

This is an upstream issue, firebase team blew up their own dependencies

You likely need these or some other way to untangle them

https://github.com/invertase/react-native-firebase/commit/dc4f57a952a7076a48a224087c9a8e7cdeaf4afc#diff-8a85188c69631f3ee1d3b09e01cdfcffae515432e9efdfb74683b880a8902172

What version includes these changes? dc4f57a?

Had similar issue at buildstep Configure project :react-native-firebase_messaging

Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.android.gms.internal.vision.zze found in modules play-services-vision-20.0.0-runtime.jar (com.google.android.gms:play-services-vision:20.0.0) and play-services-vision-common-19.1.0-runtime.jar (com.google.android.gms:play-services-vision-common:19.1.0)

I temporarily fixed this by adding the following to my project's app/build.gradle. Until Firebase sorts this issue out (https://firebase.google.com/support/release-notes/android#bom_v25-8-0)

implementation 'com.google.android.gms:play-services-vision:20.1.1'
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
Was this page helpful?
0 / 5 - 0 ratings