Tek Eye Logo

Tek Eye

Minimum Supported Gradle Version Error in Studio

Android Studio is Google's flagship Integrated Development Environment (IDE) for app development. Along with the Android Software Development Kit (SDK) Google is constantly releasing new versions as the Android Operating System (OS) develops. Studio uses the Gradle build tool. Newer versions of Gradle can be developed before Studio's default Gradle configuration gets an update. This means Studio can sometimes report Gradle errors when opening old projects, importing old projects or using later version wildcards (+) in build scripts. This article discusses the error Minimum Supported Gradle Version.

Mike Bugdroid the Android Logo

Here is an example of the error Minimum Supported Gradle Version being displayed in Studio after a project import. It can also occur when opening a project after a Studio update.

Error Minimum Supported Gradle Version

Here is a build.gradle file for the project that displayed this error:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:+'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Notice the + in the line classpath 'com.android.tools.build:gradle:+', this requests that the latest available version should be used. Sometimes a project should use a specific version, sometimes this does not matter and the latest version can be used (hence the +). However, if a newer version of Gradle is available and Studio has not been updated to use it then a version mismatch can occur when using +. To view the distributionUrl mentioned in the error message open the file gradle-wrapper.properties:

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

To clear the error replace the + with a version number that allows Studio to use a supported version of Gradle. An easy way to find Studio's default settings is simply to creat a new project. Use the File->New->New Project menu to create a new app.

Use Open Module Settings to View Default Configuration

Use the context menu (normally right-click) on the app in the Project explorer to select Open Module Settings.

Studio's Open Module Settings

The same options can be accessed via the toolbar.

Module Settings Icon

The default configuration for Studio can be seen in the Project option:

Studio's Default Gradle Settings

The same settings can be applied to the project with the Minimum Supported Gradle Version error.

Check Studio's Settings

Another check is in Studio's settings. Us the File->Settings menu option.

Studio's Settings

Check that Use default gradle wrapper (recommended) is chosen.

Studio's Gradle Options

Optionally Syncing Gradle or Invalidate Caches

Once the Gradle configuration changes have been made the Minimum Supported Gradle Version error should disappear. There may be a request to sync Gradle, which can also be done via the toolbar icon Sync Project with Gradle Files:

Gradle Sync

Some Studio users have needed to use Invalidate Caches / Restart option from the File Menu.

Studio's Invalidate Caches Options

See Also

Author:  Published:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.


Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming


Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples



Tek Eye Published Projects