The project is using an unsupported version of Gradle
Asked Answered
S

4

5

I am following this tutorial in Android Studio.

When trying to Import the project, I get a dialog saying:

"The project is using an unsupported version of Gradle." Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)"

It also fails if I select the wrapper method by stating: "Plugin with id 'com.android.application' not found.

Here is what Parse's gradle looks like:

apply plugin: 'com.android.application'

repositories {
    mavenCentral() }

dependencies {
    compile 'com.parse.bolts:bolts-android:1.1.3'
    compile fileTree(dir: 'libs', include: 'Parse-*.jar') }

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    } 
}

My project's Gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    defaultConfig {
        applicationId "id.goes.here"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    } }

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar']) 
}
Swafford answered 8/12, 2014 at 15:34 Comment(3)
What version of Android Studio are you running? Are you using the Gradle wrapper? If so, what version of Gradle are you using? This is set in /gradle/wrapper/gradle-wrapper.properties.Typology
I am using Android Studio 8.14. I believe I am using Gradle Wrapper, yes. I'll update my question showing my own Gradle.Swafford
@Tanis.7x Please check my question. I have updated it.Swafford
T
11

You generally have two build.gradles in your project:

  • A top level build.gradle in your project's root that contains buildscript {} and allprojects {} sections. This contains the project-wide configuration.
  • An app module build.gradle (located in your app's module folder) that contains the configuration for your android application. This one contains the android {} section.

Open up your top level build.gradle, and look at the Android Gradle plugin version (it will look something like classpath 'com.android.tools.build:gradle:1.0.0-rc3').

If the plugin is at version 0.13.0 or higher, you need to make sure you are using Gradle 2.1 or newer. If the plugin is below version 0.14.4, you cannot use Gradle 2.2+.

Before going further, you need to find out whether you are using a local gradle distribution or the wrapper. To do so, go to File > Settings, then search for "Gradle." If "Use local Gradle distribution" is selected, either update your local Gradle to a supported version or switch to using the wrapper.

If you are using the wrapper, the configuration for the Gradle version is located under <your-project>/gradle/wrapper/gradle-wrapper.properties. This file contains a line that will look something like this: distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip . Simply change the version at the end to a supported version.

Studio typically will offer to update the wrapper for you if you click on the error telling you that it is not a supported version.

Typology answered 8/12, 2014 at 15:58 Comment(3)
How do I know what version Parse is using? When I downloaded the SDK, it doesn't say what version it uses. Nor in the root OR the app specific Gradle.Swafford
Parse isn't using any version of Gradle. The only time the version of Gradle itself matters is when you build your project.Typology
if you can't find the gradle folder just copy paste it from another project (crate new project and then copy past the gradle folder)Testes
P
1

I resolve this issue by syncing project with gradle files.

In android studio from menu open File option and click option sync project with gradle files.

Protium answered 26/7, 2018 at 7:48 Comment(1)
This worked for me after a mac OS upgrade to Big Sur. After this and a clean in terminal the app was working fine, thanks.Roberto
I
0

Updating the distributionUrl, in the gradle-wrapper.properties file, from ...-bin.zip to ...-all.zip resolves the build issue after I Sync Project With Gradle Files (found in file menu)

Interglacial answered 11/9, 2024 at 20:37 Comment(0)
S
-1

In the project build,gradle file Replace

runProguard false

With

minifyEnabled true
Strenuous answered 12/12, 2014 at 5:53 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.