1

I get this error during gradle build when importing a project in android studio o.8.14

Gradle DSL method not found: 'android()''

I know the error has something to do with the gradle files but I don't know the way forward or where exactly to start.

The top level build.gradle file looks like this

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

android {
    compileSdkVersion 20
    buildToolsVersion '20.0.0'
}
dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:support-v4:+'
    compile 'com.google.android.gms:play-services:+'
}

And the module build.gradle file

   apply plugin: 'com.android.application'

android {
    compileSdkVersion 20
    buildToolsVersion '20.0.0'

    defaultConfig {
        applicationId "com.shimba.android.events"
        minSdkVersion 9
        targetSdkVersion 20
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
    compile project(':universalImageLoaderLibrary2')
    compile 'com.google.android.gms:play-services:+'
    compile 'com.android.support:support-v4:20.+'
}

Where am I going wrong?

mungaih pk
  • 1,809
  • 8
  • 31
  • 57
  • [http://stackoverflow.com/questions/24730117/unsupported-gradle-dsl-method-found-compile](http://stackoverflow.com/questions/24730117/unsupported-gradle-dsl-method-found-compile) – M D Nov 24 '14 at 06:46
  • [http://stackoverflow.com/questions/26851230/android-gradle-build-error9-0-gradle-dsl-method-not-found-compile](http://stackoverflow.com/questions/26851230/android-gradle-build-error9-0-gradle-dsl-method-not-found-compile) – M D Nov 24 '14 at 06:46
  • I had a similar issue yesterday, wasted 3 hr until AS showed "Unresolved Dependencies" Error and something about "Disable offline mode" – alexk Nov 29 '14 at 10:51
  • Had similar issue today, wasted 3 hours until Android Studio was kind enough to show me an error talking about "Unresolved Dependencies" and "Disable Offline Mode" - After disabling all worked fine. Here's a link i found explaining how to disable it https://plus.google.com/+AlexRuiz/posts/5TSJ3vUJPrx – alexk Nov 29 '14 at 10:53

0 Answers0