【问题标题】:Gradle 'demo' project refresh failed: Could not fetch model of type 'IdeaProject' using Gradle installationGradle“演示”项目刷新失败:无法使用 Gradle 安装获取“IdeaProject”类型的模型
【发布时间】:2013-07-25 05:29:58
【问题描述】:

我正在尝试在我的多项目中使用新的 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

Settings.gradle

include ':demo', ':screentester'

demo build.gradle 依赖块

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

【问题讨论】:

    标签: android gradle android-studio


    【解决方案1】:

    构建脚本中是否存在依赖项块?我认为您正在混合构建的类路径和项目的依赖项。它应该类似于:

    // 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')
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多