今天剛拿到新電腦

在建置環境的過程中遇到了一些問題

這次裝的 Android Studio 版本為 3.3.2

在我高高興興載下專案要 build 的時候

發生了以下的錯誤訊息

ERROR: Unsupported method: AndroidProject.getVariantNames().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

 

上網查找了一下

好像有很多人說是 Gradle 版本的問題

試了幾個方式皆不能運作

 

後來求助前輩大神

才知道是新版 Android Studio 有一些編譯問題

只要更新一下 SDK Tool 就可以正常運作了

將過程記錄如下,希望能幫到遇到相同問題的大家

 

路徑:

Android Studio

-> Preferences

-> search "sdk"

-> click "Android SDK"

-> click "SDK Tools"

-> 勾選 Android SDK Build-Tools 29...

-> 按下 OK 開始更新

一路同意過後…

重新 build 一次就可以囉!

 

 

 

 

 

文章標籤
全站熱搜
創作者介紹
創作者 顏澤偉 的頭像
顏澤偉

Willy's Fish教學筆記』

顏澤偉 發表在 痞客邦 留言(0) 人氣(827)