Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execution failed for task ':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
like image 535
Shakti Raj Singh Avatar asked Oct 25 '20 08:10

Shakti Raj Singh


People also ask

How do I fix process Appbugresources failed?

The only way to solve some errors is to clean out the cached data which can be done by Navigating to File > Invalidate Caches/Restart > Invalidate Cache and Restart.


5 Answers

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.

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")
        }
        

    }
}

like image 80
Antoni Avatar answered Oct 19 '22 13:10

Antoni


In my case i opened build.gradle and updated all libraries to the latest one just like below enter image description here

like image 39
mpountou Avatar answered Oct 19 '22 11:10

mpountou


For our Flutter Project: Navigate to app-level build.gradle file. Change compileSdkVersion from 30 to 31 and Change targetSdkVersion from 30 to 31

like image 25
Shakun's Avatar answered Oct 19 '22 13:10

Shakun's


Update 2021.07

I just had to change the compileSdkVersion and targetSdkVersion in my build.gradle file. (YourApp\android\build.gradle).

compileSdkVersion from 29 to 30
targetSdkVersion from 29 to 30

after this change, it started to run.

Credit: https://exerror.com/solved-execution-failed-for-task-appcheckdebugaarmetadata/

like image 6
Charitha Goonewardena Avatar answered Oct 19 '22 12:10

Charitha Goonewardena


It happened out of blue with my app one morning without any recent changes - I double checked with Git. The app was working yesterday without any issue. Inside android/app/build.gradle file, changing this one:

compileSdkVersion flutter.compileSdkVersion
targetSdkVersion flutter.targetSdkVersion
    

to this one solved the issue:

compileSdkVersion 32
targetSdkVersion 32
like image 2
Elmar Avatar answered Oct 19 '22 11:10

Elmar