Alberto
Alberto

Reputation: 15

Error:(19, 0) Gradle DSL method not found: 'android()' not solved

I have the problem:

Error:(19, 0) Gradle DSL method not found: 'android()'

-The project 'x' may be using a version of gradle thet does not contais the method

Open gradle wrapper file

-The build file may be missing a gradle plugin

Apply gradle plugin

build.gradle:

buildscript {

    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}

android {
    buildToolsVersion '23.0.0'
}
dependencies {
}

app.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    compileOptions {
        encoding "UTF-8"
    }

    defaultConfig {
        applicationId "es.albertoramos.pfcalbertoramos"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
}

How fix this problem?

Upvotes: 0

Views: 261

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007349

Delete:

android {
    buildToolsVersion '23.0.0'
}
dependencies {
}

from your top-level build.gradle.

Upvotes: 5

Related Questions