You import a project in the new version of Android Studio and get the following error (while running or building)
Could not find com.android.tools.build:aapt2:3.3.0-5013011.
Searched in the following locations:
…
Required by:
project :app
The problem is the missing dependency. Beginning with Android Studio 3.2 Canary 11, the source for AAPT2 (Android Asset Packaging Tool 2) is Google’s Maven repository.
The solution is simple, make sure that you have a google() dependency in your build.gradle file. Simply go to your project’s build.gradle file and add the below lines:
allprojects {
repositories {
google()
jcenter()
}
}
Ensure that the google() dependency is put right on top.
Your build.gradle file should now be:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.3.0’
}
}allprojects {
repositories {
google()
jcenter()
}
}
Hope this solution helped you. If it did, consider leaving us a link from your blog.
If you think that you have a link that adds value to this article please contact us at techie[at]techzog[dot]com for evaluation of inclusion into the article.
Comments left solely for spamming links will be deleted. Thank you for understanding.