首页 > 解决方案 > 任务“:app:checkDebugAarMetadata”执行失败,配置错误“:app:debugRuntimeClasspath”

问题描述

我正在尝试使用运行我的 Android 构建yarn android并收到以下错误:

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
   > Authentication scheme 'all'(Authentication) is not supported by protocol 'file'

这是我的 build.gradle 文件:

buildscript {
    ext {
        buildToolsVersion = '30.0.2'
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "20.1.5948944"
        kotlinVersion='1.3.72'
    }
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:4.2.2')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        // implementation 'com.google.android.material:material:1.4.0'
    }
}

allprojects {
    repositories {
        mavenLocal()
        mavenCentral()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
            credentials {
            // Do not change the username below.
            // This should always be `mapbox` (not your username). 
            username = 'mapbox'
            // Use the secret token you stored in gradle.properties as the password
            password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
        }
        }
        maven {
                url("$rootDir/..")
                }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        // maven { url 'https://www.jitpack.io' }
    }
}

我已经尝试解决这个问题很久了,任何帮助将不胜感激。我不确定构建文件是否是问题,但想确保它看起来不错。

标签: androidreact-nativebuild.gradle

解决方案


推荐阅读