未找到Gradle DSL方法:切换计算机时编译()

时间:2015-08-03 14:40:19

标签: android gradle build.gradle

在我的家庭桌面(Ubuntu)上,我的项目运行正常但是当我在工作中打开项目(ubuntu)时,项目无法同步,因为消息显示: Gradle项目同步失败。基本功能无法正常工作。

Gradle DSL method not found: 'compile()'
Error:(11,0)

这是我的模块gradle

apply plugin: 'com.android.application'
apply plugin: 'com.parse'

buildscript {
  repositories {
    mavenCentral()
    maven { url 'https://maven.parse.com/repo' }
  }
  dependencies {
      classpath 'com.parse.tools:gradle:1.+'
      compile 'com.stripe:stripe-android:+'
  }
}

dependencies {
    compile 'com.parse.bolts:bolts-android:1.2.0'
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
}

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

/* Uncomment if you enable ProGuard and you want to automatically upload symbols on build.
parse {
  applicationId YOUR_APPLICATION_ID
  masterKey YOUR_MASTER_KEY

  // Make symbol upload automatic. Otherwise, use e.g. ../gradlew parseUploadSymbolsDebug;
  uploadSymbols true
}
*/

这是项目gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'

    }
}


ext {
    compileSdkVersion = 22
    buildToolsVersion = "22"

    minSdkVersion = 9
    targetSdkVersion = 22
}

1 个答案:

答案 0 :(得分:0)

compile 'com.stripe:stripe-android:+'dependencies的{​​{1}}关闭移至您的其他buildscript关闭。 dependencies是一个库,而不是Gradle插件。