使用Android命令行工具从命令行更新Gradle版本

时间:2020-04-11 18:21:30

标签: android-studio gradle

我已经安装了Android Studio的命令行工具(commandlinetools-linux-6200805_latest.zip),并且要将gradle版本更新为6.2。

知道我该怎么做吗?

在用户界面中,我可以转到文件->项目结构。

我需要UI来做到这一点吗?

试图运行:./gradlew wrapper --gradle-version=6.2 --distribution-type=all

bash-4.2$ ./gradlew wrapper --gradle-version=6.2 --distribution-type=all

FAILURE: Build failed with an exception.

* Where:
Build file '/var/lib/jenkins/workspace/myapp/android/app/build.gradle' line: 3

* What went wrong:
An exception occurred applying plugin request [id: 'com.github.triplet.play', version: '2.7.5']
> Failed to apply plugin [class 'com.github.triplet.gradle.common.validation.RuntimeValidationPlugin']
   > Gradle Play Publisher's minimum Gradle version is at least Gradle 6.2 and yours
     is Gradle 5.6.4. Find the latest version at
     https://github.com/gradle/gradle/releases/latest, then run
     $ ./gradlew wrapper --gradle-version=$LATEST --distribution-type=ALL

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

1 个答案:

答案 0 :(得分:0)

如果使用的是Gradle包装器,则只需运行:

./gradlew wrapper --gradle-version=6.2

如果您要使用与bin不同的分布类型(默认),则可以添加distribution-type参数:

./gradlew wrapper --gradle-version=6.2 --distribution-type=all

相关问题