Firebase Have无法确定React本机Android中的依赖项问题

Firebase Have无法确定React本机Android中的依赖项问题,firebase,react-native,Firebase,React Native,我正在将firebase集成到android中,在重新升级android依赖项时遇到问题。当我像这样在rootbuild.gradle文件中添加依赖项时 implementation 'com.google.android.gms:play-services-base:16+' implementation 'com.google.firebase:firebase-core:17.2.0' 有这个问题 FAILURE: Build failed with an exception.

我正在将firebase集成到android中,在重新升级android依赖项时遇到问题。当我像这样在root
build.gradle
文件中添加依赖项时

implementation 'com.google.android.gms:play-services-base:16+'
    implementation 'com.google.firebase:firebase-core:17.2.0'
有这个问题

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-firebase:compileDebugAidl'.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.2.0,17.2.0]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
请帮助解决这个问题

app/build.gradle

dependencies {
    implementation project(':react-native-firebase')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation 'com.google.android.gms:play-services-base:16+'
    implementation 'com.google.firebase:firebase-core:17.2.0'

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

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
Android级别
build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
 classpath 'com.android.tools.build:gradle:3.3.0'
  classpath 'com.google.gms:google-services:4.0.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    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 {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        jcenter()
        maven { url 'https://jitpack.io' }
           maven {
            url 'https://maven.google.com'
        }
    }
}
这里是
package.json
文件

{
  "name": "",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.2",
    "react-native-firebase": "^5.5.6"
  },
  "devDependencies": {
    "@babel/core": "7.6.4",
    "@babel/runtime": "7.6.3",
    "@react-native-community/eslint-config": "0.0.3",
    "babel-jest": "24.9.0",
    "eslint": "6.5.1",
    "jest": "24.9.0",
    "metro-react-native-babel-preset": "0.51.1",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

在我的例子中,我们有两个

// android/app/build.gradle
implementation project(':react-native-firebase')
...
implementation project(':react-native-firebase')

所以gradle不知道该用哪个。解决方案是只列出依赖项一次。

您可以共享您的依赖项吗?@DevAS请检查我是否编辑了问题和程序包。json@DevAS请检查我是否已添加软件包。json请按照此指南操作Android问题已解决,但IOS firebase中的facing在IOS中不起作用