gradle问题 cordova

时间:2022-06-04 06:30:24

cordova升级7.0后,运行

>

ionic build android  或者

cordova build android     报出错误

Error: 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

需要下载并安装gradle:gradle-x.x-bin.zip

gradle地址:(https://services.gradle.org/distributions)

安装后添加环境变量路径:

 Gradle_path = D:\soft\gradle-4.1 PATH=%GRADLE_HOME%\bin\;

注意: gradle-4.1要求jdk在7.0以上

测试: gradle -v

重新cmd打开命令窗口。

执行:ionic build android