ionic 2 - 错误无法在Android Studio中找到已安装的Gradle版本 [英] ionic 2 - Error Could not find an installed version of Gradle either in Android Studio

查看:1584
本文介绍了ionic 2 - 错误无法在Android Studio中找到已安装的Gradle版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建离子2项目并添加诊断cordova插件,如下所示:

I create ionic 2 project and add diagnostic cordova plugin like this :

ionic plugin add cordova.plugins.diagnostic

npm install --save @ionic-native/diagnostic

并添加android平台像这样:

and add android platform like this :

ionic platform add android@latest

但是当使用离子构建android 控制台构建时,给我这个错误:

but when build with ionic build android console give me this error :

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

我尝试下载manualy gradle.3.3-all.zip并在platform / android / cordova / lib / builders / GradleBuilder.js中更改此distributionUrl var

and I try to download manualy gradle.3.3-all.zip and change this distributionUrl var in platform/android/cordova/lib/builders/GradleBuilder.js

 var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip'

to:

var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'file:///E:/gradles/gradle-3.3-all.zip';

但不工作和控制台给我上次错误。

but not working and console give me last error.

我不知道如何为Android @最新版本添加gradle

I dont know how to add gradle for android@latest version

推荐答案

尝试安装gradle并将其包含在您的路径中。点击下面的链接获取手册。
https://gradle.org/install

Try installing gradle and include it into your path. Click the link below to get manual. https://gradle.org/install

这篇关于ionic 2 - 错误无法在Android Studio中找到已安装的Gradle版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆