Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 3.2 - Could not find com.android.tools.build:aapt2:3.2.0-4818971

I was following a tutorial to develop icon pack for android and when I imported the project I got several errors and it was solved here - Gradle Version 4.6 - Absolute path are not supported when setting an output file name

After solving that error, the following error poped up.

Could not find com.android.tools.build:aapt2:3.2.0-4818971. Searched in the following locations:  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom  file:/C:/Users/Tomin Jacob/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar  https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom  https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar  https://jitpack.io/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom  https://jitpack.io/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar Required by:     project :licensing 

I tried to open the URLs and I was able to download JAR (aapt2-3.2.0-4818971-windows.jar) and JSON (aapt2-3.2.0-4818971.pom.json) files from the first 2 URLs. Should I copy these files somewhere? What should I do to solve this error?

like image 218
TomJ Avatar asked Sep 27 '18 16:09

TomJ


People also ask

Could not find com Android tools build gradle 3.2 1 searched in the following locations?

Go Settings/Gradle/Android Studio. Then check "Enable embedded Maven repository". And you're good to go.

What is AAPT2?

AAPT2 (Android Asset Packaging Tool) is a build tool that Android Studio and Android Gradle Plugin use to compile and package your app's resources. AAPT2 parses, indexes, and compiles the resources into a binary format that is optimized for the Android platform.


1 Answers

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()     } } 
like image 135
shagberg Avatar answered Oct 23 '22 12:10

shagberg