我创建了ionic 2项目,并添加了如下的诊断cordova插件:
ionic plugin add cordova.plugins.diagnostic
npm install --save @ionic-native/diagnostic
并添加这样的android平台:
ionic platform add android@latest
但是当使用ionic 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.3.3-all.zip并在platform / android / cordova / lib / builders / GradleBuilder.js中更改此distributionUrl var
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip'
至:
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'file:///E:/gradles/gradle-3.3-all.zip';
但无法正常工作,控制台会给我最后一个错误。
我不知道如何为Android @ latest版本添加gradle