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