2

Followed the steps in http://developer.android.com/samples/index.html, I imported repeatingAlarm (http://developer.android.com/samples/repeatingAlarm/project.html) project into Android Studio. Unfortunately, I get an error below:

Failed to refresh Gradle project 'repeatingAlarm' The project is using an unsupported version of the Android Gradle plug-in (0.6.3). Fix plug-in version and re-import project Quick Fix Failed Unable to find any references to the Android Gradle plug-in in build.gradle files. Please click the link to perform a textual search and then update the build files manually.

Here below is the build.gradle file:

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}

apply plugin: 'android'

dependencies {
    // Add the support lib that is appropriate for SDK 4
    compile "com.android.support:support-v4:18.0.+"
}

// The sample build uses multiple directories to
// keep boilerplate and common code separate from
// the main sample code.
List<String> dirs = [
        'main',     // main sample code; look here for the interesting stuff.
        'common',   // components that are reused by multiple samples
        'template'] // boilerplate code that is generated by the sample template process

android {
    compileSdkVersion 19
    buildToolsVersion "18.0.1"

    sourceSets {
        main {
            dirs.each { dir ->
                java.srcDirs "src/${dir}/java"
                res.srcDirs "src/${dir}/res"
            }
        }
        instrumentTest.setRoot('tests')
        instrumentTest.java.srcDirs = ['tests/src']
    }
}

And here the IDE told me an error like this: enter image description here What am I supposed to do?

53iScott
  • 827
  • 1
  • 13
  • 18

1 Answers1

2

change buildToolsVersion "18.0.1" to latest version like "20.0.1", it will work :)

akash
  • 36
  • 2