This is the configuration I have on my project:
In the build.gradle of the project I have
buildscript {
repositories {
google()
jcenter()
}
}
....
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
When I use the "Build> Rebuild Project" command in Build Output I get this error:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not download aapt2-4.1.0-6503028-windows.jar (com.android.tools.build:aapt2:4.1.0-6503028): No cached version available for offline mode
Possible solution:
- Disable offline mode and rerun the build
A month too late for this, but I was also getting a similar error with not being able to download aapt2, but for a different version number.
Turns out, the order of the google()
dependency mattered as mentioned here: https://developer.android.com/studio/releases/#aapt2_gmaven
So everywhere you are adding the dependency for google()
move it up, and it should work for you as well.
copy this
implementation 'com.android.tools.build:aapt2:4.1.0-6503028'
in Gradle in the Android Studio after that click Sync Now after finished click run to try
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.