AndroidStudio在导入别人的项目时发生报错:

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\android\study_module-main\app\build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin [id 'com.android.internal.version-check']
   > Minimum supported Gradle version is 6.5. Current version is 6.1.1. If using the gradle wrapper, try editing the distributionUrl in E:\android\study_module-main\gradle\wrapper\gradle-wrapper.properties to gradle-6.5-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 at https://help.gradle.org

在这里插入图片描述
这个错误是因为没有gradle-wrapper.properties文件,也就没有设置gradle的版本,于是就随便配了个低版的gradle。
这时只需新建一个项目,把新项目目录下的gradle目录复制到该目录下(也可以从现有的能运行的项目下复制),并修改gradle-wrapper.properties里的gradle版本到相应的版本就行了。

要是已经有gradle-wrapper.properties文件,可以直接修改gradle版本到相应的版本
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐