Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.tools.build:aapt2:3.2.0

AndroidStudio3.2 Canary14 fails clean-and-rebuild with the following error

Could not find com.android.tools.build:aapt2:3.2.0-alpha14-4748712. Searched in the following locations:     file:~/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712.pom     file:~/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712-osx.jar     file:~/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712.pom     file:~/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712-osx.jar     file:~/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712.pom     file:~/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712-osx.jar     https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712.pom     https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-alpha14-4748712/aapt2-3.2.0-alpha14-4748712-osx.jar Required by:     project :app 
like image 681
Arunabh Das Avatar asked May 10 '18 19:05

Arunabh Das


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. Android Gradle Plugin 3.0.


1 Answers

Beginning with Android Studio 3.2 Canary 11, the source for AAPT2 (Android Asset Packaging Tool 2) is Google's Maven repository.

To use AAPT2, make sure that you have a google() dependency in your build.gradle file, as shown here:

buildscript {   repositories {       google() // here       jcenter()   }   dependencies {       classpath 'com.android.tools.build:gradle:3.2.0-alpha12'   } }  allprojects {   repositories {       google() // and here       jcenter()   } } 

The new version of AAPT2 fixes many issues, including improved handling of non-ASCII characters on Windows.

Adding the repositories in the buildscript is not sufficient, you need to add it also in allprojects.

Source: https://developer.android.com/studio/releases/#aapt2_gmaven

like image 165
Izabela Orlowska Avatar answered Sep 24 '22 21:09

Izabela Orlowska