有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

找不到java Gradle DSL方法:“compile()”错误

我保证我已经看过了所有的答案

1) I wanted to use DialogFragment and developers guide suggested to install Support libraries.  I agree I did not go through and pick and choose and I asked it to install all 22 Android support libraries (Android support repository already looked installed).

2) Ensured that the project level build.gradle does not have any compile under dependencies.  Only the Module: app level build.gradle has the compile.

3) When I attempted to add the compile "com.安卓.support:support-v4:18.0.+" to the app module build.gradle, it reds on me because the target sdk is 22.  So, I go to change it to 18.  No dice.

4) Same annoying error: Gradle DSL method not found: compile():The project may be using a version that does not contain the method: open Gradle wrapper.properties OR The build file may be missing a plugin : Apply Gradle plugin

5) I applied every possible plugin.

任何帮助都将不胜感激

项目级构建。格雷德尔:

//顶层构建文件,您可以在其中添加所有子项目/模块通用的配置选项

    buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.安卓.tools.build:gradle:1.2.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

应用级构建。格雷德尔:

 apply plugin: 'com.安卓.application'

    安卓 {
    signingConfigs {
        config {
            keyAlias '******'
            keyPassword '*******'
            storeFile file('********************')
            storePassword '********'
        }
    }
    compileSdkVersion 22
    buildToolsVersion "22.0.1"
    defaultConfig {
        applicationId "project.sample.com.blatest"
        minSdkVersion 8
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'


<!-- begin snippet: js hide: false -->

<!-- language: lang-html -->

    apply plugin: 'com.安卓.application'

    安卓 {
        signingConfigs {
            config {
                keyAlias 'dialogkey'
                keyPassword 'changeme'
                storeFile file('C:/Users/ybxk021/.安卓/default.keyset')
                storePassword 'blabla123'
            }
        }
        compileSdkVersion 22
        buildToolsVersion "22.0.1"
        defaultConfig {
            applicationId "project.sample.com.dialogtest"
            minSdkVersion 8
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-安卓.txt'),        'proguard-rules.pro'
            }
        }
    }
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.安卓.support:appcompat-v7:22.2.0'
    compile 'com.安卓.support:support-v4:22.2.0'


}




}

共 (0) 个答案