Android Studio 3.2 - Could not find com.android.tools.build:aapt2:3.2.0-4818971
Solution 1:
Most likely you do not have the Google repository in your project's build.gradle file. Add google()
in BOTH locations as shown below:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Solution 2:
I was able to solve the issue by adding google() in both locations:
File -> Project Structure -> Project -> *Now add ", google()" in
Android Plugin Repository
and
Default Library Repository
*
Solution 3:
When you upgrade to 4.6 version of gradle. You need following upgrades too. Gradle Plugin Release page.
1. Android Studio 3.+
You need Android Studio version 3.+ to have 4.6 version of gradle. At the time of post latest release was 3.2.1. You can see latest release on this page.
2. Gradle Plugin 3.1.+
You need 3.1.+ gradle plugin for gradle-4.6 support. Check in project level build.gradle.
classpath 'com.android.tools.build:gradle:3.2.1'
At the time of post latest version was 3.2.1. You can see latest release here.
3. Add Google Maven Library
You need to add Google Maven library to project level build.gradle like below code.
buildscript {
repositories {
google()
...
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
...
}
}
allprojects {
repositories {
google()
...
}
}
Solution 4:
see the dependencies of module :licensing
and use com.android.tools.build:aapt2:3.2.0
(or even "com.android.tools.build:aapt2:3.2.0:windows"
) there, which is the final version ...that 4818971
version should ordinary come with an alpha
prefix/suffix (the version number seems to be incorrect). maybe adding repository google()
might be required, too. ordinary, that dependency should be present; removing that dependency might be another possible option.
Solution 5:
For those people who still face exactly the same problem even after adding two google to BOTH positions in relevant gradle file.I would suggest you to check Android Studio -> Preferences -> HTTP Proxy
page.
If you find it says some warnings like "...have set JVM proxy to 127.0.0.1".Then you should consider vpn-related issues which depends on your context.
If your desktop is MacOS, then go to Network
setting page, advance->proxy
tab,uncheck all the checkbox there.
Back to your IDE as following steps: Android Studio->File->Invalidate Caches/Restart
.After that,go back to check Android Studio -> Preferences -> HTTP Proxy
page again,previous warnings should be gone.Run again.