任务 ':app:checkDebugAarMetadata' 执行失败 [英] Execution failed for task ':app:checkDebugAarMetadata'

查看:1713
本文介绍了任务 ':app:checkDebugAarMetadata' 执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行我的应用程序时遇到此错误.

I am getting this error while running my app.

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

推荐答案

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

I already had the compileSdkVersion and targetSdkVersion on version number 30. I added to build.repositories jcenter() and to allprojects.repositories jcenter(), after that I build the react-native app and it works fine.

我的 build.gradle

My build.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")
        }
        

    }
}

这篇关于任务 ':app:checkDebugAarMetadata' 执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆