chrome mobile app fails because of gradle version

1.5k views Asked by At

I am fairly new to using cca for complex things and all my attempts fail with this error:

FAILURE: Build failed with an exception.

  • Where: Build file '/home/peterj/Documents/Projects/ChromeMobileApps/t2/platforms/android/build.gradle' line: 27

  • What went wrong: A problem occurred evaluating root project 'android'.

    Failed to apply plugin [id 'android'] Gradle version 1.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in /home/peterj/Documents/Projects/ChromeMobileApps/t2/gradle/wrapper/gradle-wrapper.properties to gradle-1.10-all.zip

I don't really know when did gradle updated but this is what I have installed with android:

Android SDK tools - 24

Android SDK platform tools 21

Android SDK build tools 19 (I have also tried with 21.1.1 - same error)

API 19 - SDK platform.

I do not see any way to downgrade the tools and plarform tools and I have also upgraded cordova and cca (with npm).

Am I missing something?

1

There are 1 answers

4
Banning On BEST ANSWER

Updated build.gradle file

https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob_plain;f=bin/templates/project/build.gradle;hb=f953e6a

buildscript {
    repositories {
        mavenCentral()
    }

    // Switch the Android Gradle plugin version requirement depending on the
    // installed version of Gradle. This dependency is documented at
    // http://tools.android.com/tech-docs/new-build-system/version-compatibility
    // and https://issues.apache.org/jira/browse/CB-8143
    if (gradle.gradleVersion >= "2.1") {
        dependencies {
            classpath 'com.android.tools.build:gradle:0.14.0+'
        }
    } else {
        dependencies {
            classpath 'com.android.tools.build:gradle:0.12.0+'
        }
    }
}