0

beginner android developer so not a lot of experience on how the gradle works, I've tried looking at other examples but I still cant get my problem. Basically, I've just downloaded one of the sample projects from google android developer examples, and cant successfully build the project. I keep getting: Gradle sync failed: Gradle DSL method not found: 'compile()'

The app gradle is:

apply plugin: 'com.android.application'

android {
    enforceUniquePackageName = false
    compileSdkVersion android_compile_version
    buildToolsVersion android_version


    defaultConfig {
        minSdkVersion android_min_sdk_version
        targetSdkVersion android_compile_version
        versionCode 1
        versionName "1.0"
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile "com.android.support:appcompat-v7:${appcompat_library_version}"
    compile "com.android.support:support-v4:${support_library_version}"
    compile project(':libraries:BaseGameUtils')
    compile 'com.google.android.gms:play-services:4.3.23'
}

buildscript {
    repositories {
        jcenter()
    }
}

and as for the project gradle:

// this is the parent build configuration for all the sample projects.
// for more information on gradle build files when used in a multi-project build, see
// http://gradle.org/docs/current/userguide/multi_project_builds.html

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
    }
}

// allprojects apply to every project
allprojects {
    repositories {
        jcenter()
    }

    ext {
        android_compile_version = 23
        android_version = '23.0.1'
        android_min_sdk_version = 9

        appcompat_library_version = '23.0.1'
        support_library_version = '23.0.1'
        gms_library_version = '8.1.0'
    }
}
  • i think you find your answer [here](http://stackoverflow.com/questions/27156428/getting-error-gradle-dsl-method-not-found-compile-when-syncing-build-grad) – pRaNaY Oct 18 '15 at 12:00
  • Could you please provide the link of project you downloaded? – Palak Nov 09 '15 at 07:54

0 Answers0