2

我正在尝试在我的多项目上使用新的 gradle android 构建系统。我有依赖于它的库项目和演示项目。我有依赖块的问题。

Gradle 'demo' project refresh failed:
        Could not fetch model of type 'IdeaProject' using Gradle installation '/Users/lia/Worktable/gradle/tools/external/gradle/gradle-1.6'.
        Build file '/Users/lia/Worktable/screen-tester-android/demo/build.gradle' line: 43
        A problem occurred evaluating project ':demo'.
        A problem occurred evaluating project ':demo'.
        No signature of method: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile() is applicable for argument types: (org.gradle.api.internal.project.DefaultProject_Decorated) values: [project ':screentester']
        Possible solutions: module(java.lang.Object)

使用 gradle 1.6

设置.gradle

include ':demo', ':screentester'

演示 build.gradle 依赖块

    dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
    compile project(':screentester')
}
4

1 回答 1

2

buildscript 中的依赖项是否阻塞?我认为您正在混合构建的类路径和项目的依赖项。它应该看起来像:

// this is to configure the code running the build, ie where to find the plugin
buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:0.5.+'
  }
}

// now we configure the project itself
dependencies {
  compile project(':screentester')
}
于 2013-07-25T05:56:32.437 回答