I had an Android project created using Android Studio and try to import and run it in my Android studio, but before the error below, when trying to synchronize the project
Failed to sync Gradle project 'project-android' Error:Gradle version 1.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in /Users/username/apps/android/project-android/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip. Please fix the project Gradle settings in Gradle settings
gradle -wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
build.gradle
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } allprojects { repositories { mavenCentral() } } Android Studio Version : 1.0.1
So how to fix the above error
Edit
After changing the lines, as pointed out by @Grabiele, I received the following errors:
Error:(22, 0) Gradle DSL method not found: 'runProguard()' Possible causes: The project 'project-android' may be using a version of Gradle that does not contain the method. The build file may be missing a Gradle plugin.
This is the line I had in the app/build.gradle
buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } }
source share