Getting the error “duplicate entry: com/google/android/gms/internal/zzble.class” when trying to add a package

前端 未结 6 1104
囚心锁ツ
囚心锁ツ 2020-12-16 13:31

I\'m trying to add the react-native-firestack package to my app. But it keeps giving the following error :

:app:mergeDebugResources UP-TO-DATE
:         


        
6条回答
  •  忘掉有多难
    2020-12-16 13:53

    I'm sure you have apply plugin: 'com.google.gms.google-services' somewhere in your build.gradle file, probably on top.

    This line has to be after dependencies block - this allows the plugin to determine what version of Play services you are using.

    You can refer to https://firebase.google.com/docs/android/setup#add_the_sdk for more information.

    In your case it should look like this:

    dependencies {
        compile(project(":react-native-firestack"))
        compile project(':react-native-onesignal')
        compile project(':react-native-fbsdk')
        compile project(':react-native-share')
        compile project(':react-native-video')
        compile project(':react-native-uuid-generator')
        compile project(':react-native-udp')
        compile project(':react-native-tcp')
        compile project(':react-native-camera')
        compile project(':react-native-contacts')
        compile project(':react-native-linear-gradient')
        compile project(':react-native-vector-icons')
        compile fileTree(dir: "libs", include: ["*.jar"])
        compile "com.android.support:appcompat-v7:23.0.1"
        compile "com.facebook.react:react-native:+"  // From node_modules
        compile project(':react-native-image-picker')
        compile(project(":react-native-google-signin")){
        exclude group: "com.google.android.gms" // very important
        }
        compile 'com.google.android.gms:play-services-auth:10.2.0'
        compile 'com.google.firebase:firebase-crash:10.0.1'
    }
    
    // after dependencies block
    apply plugin: 'com.google.gms.google-services'
    

提交回复
热议问题