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.
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