Android Studio 3.2 - 找不到 com.android.tools.build:aapt2:3.2.0-4818971 [英] Android Studio 3.2 - Could not find com.android.tools.build:aapt2:3.2.0-4818971
问题描述
我正在学习为 android 开发图标包的教程,当我导入项目时,我遇到了几个错误,在这里解决了 - Gradle Version 4.6 - 设置输出文件名时不支持绝对路径
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
我尝试打开 URL,并且能够从前 2 个 URL 下载 JAR (aapt2-3.2.0-4818971-windows.jar) 和 JSON (aapt2-3.2.0-4818971.pom.json) 文件.我应该将这些文件复制到某个地方吗?我应该怎么做才能解决这个错误?
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?
推荐答案
很可能您的项目的 build.gradle 文件中没有 Google 存储库.在两个位置添加 google()
,如下所示:
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()
}
}
这篇关于Android Studio 3.2 - 找不到 com.android.tools.build:aapt2:3.2.0-4818971的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!