(错误39,0)发现Gradle方法注释:'compile()'

时间:2015-12-30 09:32:16

标签: android android-gradle build.gradle

我收到以下错误:错误(39,0)Gradle方法注释:'compile()'

This is the error I get

以下解决方案似乎不起作用:

Gradle DSL method not found: 'compile()'

gradle DSL method not found: 'compile()' persisting error

这是我的整个gradle.build文件

    apply plugin: 'com.android.application'

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

    allprojects {
    repositories {
        jcenter()
    }
    }
android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "com.audacityit.finder"
        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:23.0.1'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    apply plugin: 'maven'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.google.android.gms:play-services-ads:7.8.0'
    compile 'com.google.android.gms:play-services-identity:7.8.0'
    compile 'com.google.android.gms:play-services-gcm:7.8.0'
}

我到底哪里出错?

1 个答案:

答案 0 :(得分:1)

首先,您需要升级compileSdkVersion版本& targetSdkVersion版本。

compileSdkVersion 23 
targetSdkVersion 23

最后

 android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "com.audacityit.finder"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }