Cordova報錯Could not find an installed version of Gradle either in Android Studio

字號+ 編輯: 国内TP粉 修訂: 小红帽 來源: 原创 2023-09-10 我要說兩句(0)

Could not find an installed version of Gradle either in Android Studio,or on your system to install the gradle wrapper. Please include gradle in your path, or install Android Studio

當剛剛使用cordova requirements的時候, 會提示:

Gradle: not installed 
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle 
in your path, or install Android Studio

按照提示的建議, 安裝Android Studio, 但是就算是重啓, 仍然會有這樣的報錯的,那麽在Android studio右上角的終耑中

未標題-1.jpg

輸入

gradlew -v

這樣Android Studio會後台自動下載gradle。稍等一會兒安裝完畢, 重啓一下,看能否解決。

筆者在mac安裝gradle過程中使用的是java JDK1.8, 所以外部手動安裝gradle5.6,終耑窗口會提示至少需要JDK9+的依賴,怎麽辦呢?用到brew幫忙:

brew install gradle

一個命令就解決了。奇怪的是居然java JDK還是1.8就能安裝進去的。

閲完此文,您的感想如何?
  • 有用

    4

  • 沒用

    1

  • 開心

    2

  • 憤怒

    4

  • 可憐

    1

1.如文章侵犯了您的版權,請發郵件通知本站,該文章將在24小時内刪除;
2.本站標注原創的文章,轉發時煩請注明來源;
3.交流群: 2702237 13835667

相關課文
  • Invalid prop custom validator check failed for prop navigationBarTextStyle

  • svg是什麽文档格式?如何打開svg文档?

  • flutter基礎名詞和簡單代碼案例

  • 支付寶小程序不支持html語法富文本,在Uniapp上的解決方法

我要說說
網上賓友點評