解决AndroidStudio编译出现"Could not resolve all files for configuration ':library:_internal_aapt2_binary'"
解决AndroidStudio编译出现"Could not resolve all files for configuration ‘:library:_internal_aapt2_binary’"问题
错误描述
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':library:_internal_aapt2_binary'.
> Could not find com.android.tools.build:aapt2:3.2.0-4818971.
Searched in the following locations:
file:/E:/AndroidSdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/E:/AndroidSdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar
file:/E:/AndroidSdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/E:/AndroidSdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar
file:/E:/AndroidSdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/E:/AndroidSdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar
https://repo.maven.apache.org/maven2/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
https://repo.maven.apache.org/maven2/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-windows.jar
Required by:
project :library
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
解决方法
再项目Gradle
的allprojects
中添加google()
如图: