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


Posted on : Mon, 5th Oct 15 07:52 am UTC
2314 votes
Error:(19, 0) Gradle DSL method not found: 'android()'

Possible causes: The project 'Example' may be using a version of the Android 
Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).

Fix plugin version and sync project
The project 'Example' may be using a version of Gradle that does not contain the method.
The build file may be missing a Gradle plugin.

Apply Gradle plugin
Gradle DSL method not found


Error : Gradle DSL method not found

Just remove the following code from build.gradle file

build.gradle Language : XML
android {
    compileSdkVersion 'android-MNC'
    buildToolsVersion 'xx.x.x'
}
dependencies {
}

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +