0

I'm on Ubuntu 14.04 and I'm using version 0.5.2 of Android Studio. I'm trying to import this project to my Android Studio GCM SAMPLE

But I get this error: enter image description here

It says that I should use the version 1.10 of Gradle.

However, I am Indeed using that version. enter image description here

What is happening here?

Jezer Crespo
  • 2,152
  • 3
  • 24
  • 27

1 Answers1

2

It's giving you the wrong error message. The actual problem is that the project is using the wrong version of the Android Gradle plugin -- this project specifies 0.7, but Android Studio 0.5.2 needs 0.9.

In the project's top-level build.gradle, in this block:

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

change the classpath line to:

        classpath 'com.android.tools.build:gradle:0.9.+'
Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • There's no buildscript block in the project's build.gradle I Just tried to place it together with the other items in the dependency block. Like this: dependencies { compile 'com.google.android.gms:play-services:4.0.30' compile 'com.android.support:appcompat-v7:+' compile 'com.android.support:support-v4:19.0.0' compile 'de.greenrobot:eventbus:2.2.0' compile 'de.keyboardsurfer.android.widget:crouton:1.8.2' classpath 'com.android.tools.build:gradle:0.9.+' } But It still throws the same error – Jezer Crespo Jun 15 '14 at 13:56
  • It's this file: https://github.com/writtmeyer/gcm_sample/blob/master/build.gradle – Scott Barta Jun 15 '14 at 13:58
  • Oh yes, In the top level. Sorry. I'm gonna try it now – Jezer Crespo Jun 15 '14 at 13:59
  • That `classpath` statement you put in your other `dependencies` block is wrong. Take it out. – Scott Barta Jun 15 '14 at 14:03