【已解決】FAILURE: Build failed with an exception......

一:異常信息

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 resolve
com.android.tools.build:aapt2:3.6.1-6040484.
Required by:
project :app
No cached version of com.android.tools.build:aapt2:3.6.1-6040484 available for offline mode.
No cached version of com.android.tools.build:aapt2:3.6.1-6040484 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

BUILD FAILED in 3s

在這裏插入圖片描述

二:解決辦法

將 gradle 降低版本即可,編譯就好了。如果不知道改爲哪個版本,就新建一個項目,看看是什麼版本的,直接改爲相應的版本即可。

在這裏插入圖片描述
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章