繁体   English   中英

支持的最低Gradle版本为4.6。 当前版本是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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM