gradle 构建失败 Build step 'Invoke Gradle script' changed build result to FAILURE

上传代码发现报错

Build step 'Invoke Gradle script' changed build result to FAILURE

提示:Minimum supported Gradle version is 6.1.1. Current version is 5.1.1. If using the gradle wrapper

在Android studio中运行 gradle报下面错误


* Where:Build file '/Data/jenkins/agent/workspace/Android_127_370/ad_pr_job_134_Android_127_develop_1995/app/build.gradle' line: 1* What went wrong:A problem occurred evaluating project ':app'.> Failed to apply plugin [id 'com.android.internal.version-check'] > Minimum supported Gradle version is 6.1.1. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in /Data/jenkins/agent/workspace/ANDROID_PR_Android_127_370/ad_pr_job_134_Android_127_develop_1995/gradle/wrapper/gradle-wrapper.properties to gradle-6.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. Run with --scan to get full insights.* Get more help athttps://help.gradle.orgBUILD FAILEDin 5sBuild step 'Invoke Gradle script' changed build result to FAILUREBuild step 'Invoke Gradle script' marked build as failureRecording test results[Checks API] No suitable checks publisher found.Publishing Clover coverage report...No Clover report will be published due to a Build Failure


解决方法:

导入的项目使用的Android gradle 插件,  与当前你的Android studio 的Android gradle 版本不对应,导致Gradle 版本对应不上.

官方对应地址

https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin

你可能感兴趣的:(gradle 构建失败 Build step 'Invoke Gradle script' changed build result to FAILURE)