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
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.
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")
}
}
}
In my case i opened build.gradle
and updated all libraries to the latest one just like below
For our Flutter Project: Navigate to app-level build.gradle file. Change compileSdkVersion from 30 to 31 and Change targetSdkVersion from 30 to 31
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/
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With