首页/Ionic/列表

Error: Could not find an installed version of Gradle either in Android Studio...

来源:  2018-04-11 11:18:03    评论:0点击:

Error: Could not find an installed version of Gradle either in Android Studio...


 CordovaError: Could not find an installed version of Gradle either in Android Studio,

ionic升级到3.0之后,在使用命令:ionic cordova build android或者ionic cordova emulate 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
报错的原因:
cordova在6.4.0(cordova-android在6.1.2)之后,会要求安装Gradle,基于Gradle来编译、打包android。(具体版本号有待考证,但是需要安装Gradle属实)

解决办法:

1、手动下载gradle
gradle-x.x-bin.zip (x.x代表版本)
根据需要下载某一版本
地址: (https://services.gradle.org/distributions)
我下载的是gradle-3.5

下载完成后,解压到任意文件夹下

2、添加环境变量
PATH=F:\gradle-3.5\bin

3、关闭cmd

4、打开cmd,输入gradle -v,查看是否安装成功

5、继续使用ionic cordova build android --prod --release
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权