问题
Following things are using in the project-
The android studio version - 2.0 Preview 4.
ANDROID_BUILD_MIN_SDK_VERSION=9
ANDROID_BUILD_TARGET_SDK_VERSION=22
ANDROID_BUILD_TOOLS_VERSION=22.0.1
ANDROID_BUILD_SDK_VERSION=22
classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
As per the error I changed the distribution url
https\://services.gradle.org/distributions/gradle-2.8-all.zip
to
https\://services.gradle.org/distributions/gradle-2.10-all.zip
but still getting the following error
Error:(1, 1) A problem occurred evaluating project ':app'. Failed to apply plugin [id 'com.android.application'] Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in /Users/manishpathak/Project/live/code/ICCCricketWorldCup2015Schedule/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip
回答1:
update your android studio version to 1.5.1. Your problem will be solved. If your android version is updated. Try it out:
change Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path OR
set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this:
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
try this
回答2:
You just need to update the path for gradle directory from gradle-2.8 to gradle-2.10
Steps:
Click on file ->settings ->gradle
Choose "Use local gradle distribution" radio button in the project-level setting
open and paste the path of the directory of gradle-2.10
( Note : Path will be similar to where gradle-2.8 was earlier present if you have done any update for android studio, or else you have to mention the path of download directory if you have downloaded the standalone gradle distribution from http://gradle.org/gradle-download/ )
change the gradle 2.8 to gradle 2.10 in file ->settings ->gradle
Apply the settings and rebuild the project.
回答3:
Option 1
First Try: Update gradle-wrapper.properties file located in [Project\gradle\wrapper\gradle-wrapper.properties] update distributionUrl distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
if above doesn't work follow following steps as well
Option 2
Step1: Check gradle version: Gradle generally is installed in folder: C:\Program Files\Android\Android Studio\gradle\gradle[version number] eg gradle-4.1
Step2: update gradle is installed, download the gradle from https://services.gradle.org/distributions/ for you download it https://services.gradle.org/distributions/gradle-2.10-bin.zip and place it in studio gradle folder or some where else
step 3: update gradle path for (project specific or global as required) File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path
Option 3 File>Project Structure>Project>Gradle version, change it to 2.10
回答4:
for this question change File>Project Structure>Project>Gradle version from 2.8 to 2.10 just so
来源:https://stackoverflow.com/questions/35153112/gradle-version-2-10-is-required-current-version-is-2-8-error