Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

David Axelrod
36,073 PointsEndlessly frustrating. error (3,0) Gradle DSL method not found 'android()'
read through the forum posts and have this error come up when i change the gradle file. I dont even see android() defined. I also get the error Error:(2,0) plugin with id com.android.application not found. Thanks!
here are my files
gradle-wrapper.properties
#Mon Jul 06 17:04:59 EDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId 'jasonphillipsdev.stormy'
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName '1.0'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/commons-io-2.4.jar')
compile 'com.android.support:support-v13:21.0.3'
}
settings.gradle
include ':app'
2 Answers

Marcus Pereira
7,985 PointsEarlier this year I wrote a quick article on Medium showing how I solved this issue.
In short, Android Studio incorrectly adds the android() method in the top-level build.gradle file. Just delete the method. :)

Seth Kroger
56,403 PointsI'd guess the second error is causing the first because if android() is defined anywhere the android plugin is a good place for it. Googling the 2nd error brought up this: http://stackoverflow.com/questions/24795079/error1-0-plugin-with-id-com-android-application-not-found I'd start with checking the project's build.gradle file (not the app module's you listed) and go from there.