当前位置: 首页 > 知识库问答 >
问题:

任务“:app:CheckDebugaArmetadata”执行失败

祁远
2023-03-14

我在运行我的应用程序时得到了这个错误。

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.android.support.constraint:constraint-layout:1.1.3.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.1.3/constraint-layout-1.1.3.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :app
   > Could not find com.android.support:appcompat-v7:25.3.1.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :app
   > Could not find com.android.support:support-v4:25.3.1.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/support/support-v4/25.3.1/support-v4-25.3.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :app
   > Could not find com.android.support:design:25.3.1.
     Searched in the following locations:
       - https://jcenter.bintray.com/com/android/support/design/25.3.1/design-25.3.1.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
     Required by:
         project :app

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

共有1个答案

晏望
2023-03-14

我已经有了版本号30上的compileSdkVersion和targetSdkVersion。我添加到build.repositoriesjcenter()allprojects.repositoriesjcenter(),然后构建react-native应用程序,它运行良好。

我的建筑。Gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

allprojects {
    repositories {
        mavenCentral()
        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 {
            // All of the Detox artifacts are provided via the npm module
            url("$rootDir/../../../node_modules/detox/Detox-android")
        }
        

    }
}

 类似资料: