Search code examples
androidandroid-studioandroid-gradle-plugingradle-plugingradle-experimental

In Android Studio 2.1.3 is experimental gradle not working?


I have a project where I mix and match regular Android Gradle Plugin:

apply plugin: 'com.android.library'

and Experimental Gradle Plugin as a library:

apply plugin: 'com.android.model.library'

In my overall build.gradle I have the following dependencies:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.android.tools.build:gradle-experimental:0.7.2'
        classpath 'com.android.tools.build:gradle:2.1.3'
    }
}

And now after upgrade to Android 2.1.3, I get the following error right after the Gradle Sync:

Gradle sync failed: Gradle version 2.10 is required. Current version is >2.14.1. If using the gradle wrapper, try editing the distributionUrl in ?>blah blah blah

At this time In the .idea Android Studio IDE log I see the following error:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: >Failed to apply plugin [class >'com.android.build.gradle.model.AndroidComponentModelPlugin']

When I fix the gradle-wrapper.properties file I get the following after Gradle Sync:

Error:Minimum supported Gradle version is 2.14.1. Current version is >2.10. If using the gradle wrapper, try editing the distributionUrl in >/Users/development/Desktop/android_msdk/xFAClient/Android/xFA/gradle/wrapp>er/gradle-wrapper.properties to gradle-2.14.1-all.zip

And over and over again...

I have no clue here...


Solution

  • Upgrade gradle experimental to 0.7.3:

         classpath 'com.android.tools.build:gradle-experimental:0.7.3'
    

    It allows gradle wrapper 2.14.1 compatibility.