![](/img/trans.png)
[英]Ionic Android Minimum supported Gradle version is 4.6. Current version is 4.1
[英]Minimum supported Gradle version is 4.6. Current version is 4.1
錯誤地,我刪除了我的離子項目的android平台,當我重新安裝它時,它標記了我運行cordova build --release android
時的錯誤cordova build --release android
這是我的離子信息
離子型:
ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.4.1
科爾多瓦:
cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 6.4.0, browser 6.0.0, ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 7 other plugins)
系統:
Android SDK Tools : 26.1.1 (/Users/usuario/Library/Android/sdk)
NodeJS : v10.15.3 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
MacBook-Air-de-Usuario:HogApp_29_mayo_2019 usuario$ cordova build --release android
ANDROID_HOME=/Users/usuario/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
Subproject Path: CordovaLib
FAILURE:構建因異常而失敗。
* Where:
Build file '/Users/usuario/Desktop/HogApp_29_mayo_2019/platforms/android/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.android.application']
> Minimum supported Gradle version is 5.1.1. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/usuario/Desktop/HogApp_29_mayo_2019/gradle/wrapper/gradle-wrapper.properties to gradle-5.1.1-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
/Users/usuario/Desktop/HogApp_29_mayo_2019/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/usuario/Desktop/HogApp_29_mayo_2019/platforms/android/build.gradle' line: 20
* What went wrong:
A problem occurred evaluating root project 'android'.
> Failed to apply plugin [id 'com.android.application']
> Minimum supported Gradle version is 5.1.1. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/usuario/Desktop/HogApp_29_mayo_2019/gradle/wrapper/gradle-wrapper.properties to gradle-5.1.1-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
您應該再次刪除Android平台,請安裝6.4.0版本。 它有助於解決該問題,或者您可以在gradle-wrapper文件中升級gradle版本。
對於添加Android 6.4.0版本運行以下命令:
離子cordova平台添加android@6.4.0
添加到上一個答案, 這里是Cordova Android平台指南的文檔。 這將告訴您版本和支持的版本以及Gradle版本信息。 因此,在幫助下刪除和重新下載正確的Android平台版本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.