Android Studio显示此错误。无法找出导致错误的原因。
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
> Could not download aapt2-windows.jar (com.android.tools.build:aapt2:3.6.2-6040484): No cached version available for offline mode
* 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
答案 0 :(得分:0)
问题在于下载依赖项:
Could not download aapt2-windows.jar (com.android.tools.build:aapt2:3.6.2-6040484): No cached version available for offline mode
。
这意味着,由于您处于离线模式或没有Internet连接,因此无法下载依赖项。尝试关闭Gradle的离线模式,检查 Internet连接,然后尝试重新构建。