Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1.

遇到的问题
Windows操作系统下,在导入一个Android工程到Android Studio中时,调试时Gradle报错,错误提示如下:

--------------------------------------------------------------------------------------------
FAILURE: Build failed with an exception.
 Where:Build file 'F:\AndroidStudioProjects\BundleTest\app\build.gradle' line: 1

What went wrong:A problem occurred evaluating project ':app'.
> Failed to apply plugin [id'com.android.application']  
> Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in F:\AndroidStudioProjects\BundleTest\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
 
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
--------------------------------------------------------------------------------------------

解决办法
需检查一下几个地方,完全保持一致,即可解决这个问题

1.检查本地Gradle Version设置是否正确(具体参考可打包项目)

Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1._第1张图片
QQ截图20170825161139.png
Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1._第2张图片
QQ截图20170825161218.png

2.查看目录xxx项目\gradle\wrapper\gradle-wrapper.properties设置是否正确(具体参考可打包项目)

Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1._第3张图片
QQ截图20170825161439.png

3.查看目录xxx项目\build.gradle设置是否正确(具体参考可打包项目)

Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1._第4张图片
QQ截图20170825161715.png

你可能感兴趣的:(Android Studio 解决Gradle version Gradle version 2.10 is required. Current version is 2.2.1.)