Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为我的项目集成react native firebase for android时出错_Android_React Native_React Native Firebase - Fatal编程技术网

为我的项目集成react native firebase for android时出错

为我的项目集成react native firebase for android时出错,android,react-native,react-native-firebase,Android,React Native,React Native Firebase,以下是全部错误: FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':react-native-azure-adal:javaPreCompileDebug'. > In project 'app' a resolved Google Play services library dependency depends on another at an exact vers

以下是全部错误:

FAILURE: Build failed with an exception.
 What went wrong: Execution failed for task ':react-native-azure-adal:javaPreCompileDebug'. > In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[1.3.1 ,2.3]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

    Dependency failing: com.nimbusds:nimbus-jose-jwt:5.7 -> net.minidev:json-smart@[1.3.1,2.3], but json-smart version was 2 .3.

    The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends on project 'react' which depends onto com.microsoft.aad:adal@1.15.+ -- Project 'app' depends on project 'react' which depends onto com.microsoft.identity:common@{strictly 0.0.4} -- Project 'app' depends on project 'react' which depends onto com.nimbusds:nimbus-jose-jwt@{strictly 5.7} -- Project 'app' depends on project 'react' which depends onto net.minidev:json-smart@{strictly 2.3} -- Project 'app' depends on project 'react' which depends onto com.microsoft.aad:adal@{strictly 1.15.1}

    For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b uild.gradle file.

    Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    Get more help at https://help.gradle.org

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD FAILED in 44s 88 actionable tasks: 88 executed error Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
我已经遵循了此链接中指定的步骤

我的applevel build.gradle文件如下:

buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
googlePlayServicesVersion = '16.0.0'
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
我的android/app/build.gradle

    apply plugin: "com.android.application"

    import com.android.build.OutputFile
    import groovy.json.JsonSlurper
    /**

    The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
    and bundleReleaseJsAndAssets).
    These basically call react-native bundle with the correct arguments during the Android build
    cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
    bundle directly from the development server. Below you can see all the possible configurations
    and their defaults. If you decide to add a configuration block, make sure to add it before the
    apply from: "../../node_modules/react-native/react.gradle" line.
    project.ext.react = [
    // the name of the generated asset file containing your JS bundle
    bundleAssetName: "index.android.bundle",
    // the entry file for bundle generation
    entryFile: "index.android.js",
    // whether to bundle JS and assets in debug mode
    bundleInDebug: false,
    // whether to bundle JS and assets in release mode
    bundleInRelease: true,
    // whether to bundle JS and assets in another build variant (if configured).
    // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
    project.ext.react = [
    entryFile: "index.js"
    ]

    apply from: "../../node_modules/react-native/react.gradle"
    apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
    apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

    /**

    Set this to true to create two separate APKs instead of one:
    An APK that only works on ARM devices
    An APK that only works on x86 devices
    The advantage is the size of the APK is reduced by about 4MB.
    Upload all the APKs to the Play Store and people will download
    the correct one based on the CPU architecture of their device.
    */
    def enableSeparateBuildPerCPUArchitecture = false
    /**

    Read versionCode abd versionName
    */
    def getVersionCode() {
    def inputFile = new File("../packaging/build_scripts/androidVersionInfo.json")
    def packageJson = new JsonSlurper().parseText(inputFile.text)
    return packageJson["versionCode"]
    }
    def getVersionName() {
    def inputFile = new File("../packaging/build_scripts/androidVersionInfo.json")
    def packageJson = new JsonSlurper().parseText(inputFile.text)
    return packageJson["versionName"]
    }

    def buildVersionCodeVer = getVersionCode()
    def buildVersionNameVer = getVersionName()



 1. /**

        Run Proguard to shrink the Java bytecode in release builds.
        */
        def enableProguardInReleaseBuilds = false
        android {
        compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        renderscriptTargetApi 23
        renderscriptSupportModeEnabled true
        multiDexEnabled true
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    buildTypes {
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
    dependencies {
    implementation project(':react-native-firebase')
    implementation project(':react-native-android-open-settings')
    implementation project(':react-native-svg')
    implementation project(':react-native-image-crop-picker')
    implementation project(':react-native-splash-screen')
    implementation project(':@react-native-community_blur')
    implementation(project(':react-native-geolocation-service')) {
    exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
    implementation "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
    implementation(project(':react-native-maps')) {
    exclude group: 'com.google.android.gms', module: 'play-services-base'
    exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation "com.google.android.gms:play-services-base:16.1.0"
    implementation "com.google.android.gms:play-services-maps:$googlePlayServicesVersion"
    implementation project(':react-native-linear-gradient')
    implementation project(':react-native-code-push')
    implementation project(':react-native-device-info')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-version-number')
    implementation project(':appcenter-crashes')
    implementation project(':react-native-gesture-handler')
    implementation project(':appcenter-analytics')
    implementation project(':appcenter')
    implementation project(':react-native-azure-adal')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
    implementation "com.facebook.react:react-native:+" // From node_$googlePlayServicesVersionmodule
    implementation "com.google.firebase:firebase-core:16.0.9"
    }

    // 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 plugin: 'com.google.gms.google-services'
  • 当我降级classpath的版本时 从'com.google.gms:googleservices'到4.0.1,上面的错误是 已解决,但给出了此错误

  • 你运气好吗?你运气好吗?
     - The library com.google.android.gms:play-services-measurement-base is
       being requested by various other libraries at [[15.0.4,15.0.4]], but
       resolves to 16.5.0. Disable the plugin and check your dependencies
       tree using ./gradlew :app:dependencies. > The library
       com.google.firebase:firebase-analytics is being requested by various
       other libraries at [[16.0.0,16.0.0]], but resolves to 16.5.0. Disable
       the plugin and check your dependencies tree using ./gradlew
       :app:dependencies.