Cordova 生成Android的gradle问题

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)

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

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

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

测试: gradle -v

重新cmd打开命令窗口。

执行:ionic build android 

特别说明:如果使用VS Code开发,在终端使用命令,也需要重新启动VS Code,在设置完环境变量后。


更多:

Apache Cordova开发环境搭建(二)VS Code

Ionic2开发环境搭建-VS 2017

Ionic3开发环境搭建-VS Code

猜你喜欢

转载自blog.csdn.net/u011127019/article/details/79196219
今日推荐