簡體   English   中英

Ionic Android最低支持的Gradle版本是4.6。 當前版本是4.1

[英]Ionic Android Minimum supported Gradle version is 4.6. Current version is 4.1

我運行命令:“ $ ionic cordova build android”,但我會收到此錯誤。 您知道如何解決此錯誤嗎?

Preparing Firebase on Android
ANDROID_HOME=/Users/henriaycard/Library/Android/sdk
JAVA_HOME=/Users/henriaycard/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home
studio
Subproject Path: CordovaLib
Subproject Path: app

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/henriaycard/git/ionic/upsudEvenement/platforms/android/CordovaLib/build.gradle' line: 41

* What went wrong:

A problem occurred evaluating project ':CordovaLib'.
> 
Failed to apply plugin [id 'com.android.library']

   > 
Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/henriaycard/git/ionic/upsudEvenement/gradle/wrapper/gradle-wrapper.properties to gradle-4.6-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 1s
(node:35261) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /Users/henriaycard/git/ionic/upsudEvenement/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Build file '/Users/henriaycard/git/ionic/upsudEvenement/platforms/android/CordovaLib/build.gradle' line: 41

* What went wrong:
A problem occurred evaluating project ':CordovaLib'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/henriaycard/git/ionic/upsudEvenement/gradle/wrapper/gradle-wrapper.properties to gradle-4.6-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 1s
(node:35261) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[ERROR] An error occurred while running cordova run android (exit code 1).

如果您使用的是Mac,請在.bash_profile中添加以下行,然后執行“ source〜/ .bash_profile”

export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="https\://services.gradle.org/distributions/gradle-4.7-all.zip"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM