1

I've successfully installed Android Studio (0.6.1) on OS X (10.9.3). I can't get my first Hello World! project... Please help me solve this issue

This is the error I got:

Error:(19, 0) Build script error, unsupported Gradle DSL method found: 'android()'!

Possible causes could be:
- you are using Gradle version where the method is absent (Fix Gradle settings) - you didn't apply Gradle plugin which provides the method (Apply Gradle plugin) - or there is a mistake in a build script (Goto source)

Update: (code, error message)

Script:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {}
}

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1'
    defaultConfig {}
    productFlavors {
    }
}

dependencies {
}

Error message:

Error:(8, 0) Plugin with id 'android' not found.

user927584
  • 395
  • 2
  • 6
  • 14

1 Answers1

0

Modify it to next:

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

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

apply plugin: 'android' 

repositories {
  mavenCentral()
} 

android {
  compileSdkVersion 19
  buildToolsVersion '19.1.0'
  defaultConfig {}
  productFlavors {
  } 
}

dependencies { }
Eugen Martynov
  • 19,888
  • 10
  • 61
  • 114