Intellij idea Intellij idea gradle子模块总是忘记根项目依赖关系

Intellij idea Intellij idea gradle子模块总是忘记根项目依赖关系,intellij-idea,gradle,Intellij Idea,Gradle,我有两个gradle项目定义如下 apiclient (root) | src\ | build.gradle |--- android (module) | src\ | build.gradle apiclient.android build.gradle group 'emby.apiclient' version '1.0-SNAPSHOT' apply plugin: 'java' sourceCompatibility = 1.7

我有两个gradle项目定义如下

apiclient (root) | src\ | build.gradle |--- android (module) | src\ | build.gradle apiclient.android build.gradle

group 'emby.apiclient'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.7

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.3.11'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'com.google.guava:guava:18.0'
    compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
group 'emby.apiclient'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.7

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'org.codehaus.groovy:groovy-all:2.3.11'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'com.google.code.gson:gson:2.5'
    compile 'com.mcxiaoke.volley:library:1.0.16'
    compile 'com.squareup.okhttp:okhttp:2.1.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
    compile 'emby.apiclient:apiclient:1.0-SNAPSHOT'
}
rootProject.name = 'apiclient'
include 'android'
findProject(':android')?.name = 'emby.apiclient.android'
gradle项目窗口中的最后一行
compile'emby.apiclient:apiclient:1.0-SNAPSHOT'
带有红色下划线。我也尝试过
编译项目'apiclient'
,结果没有改变

设置。渐变

group 'emby.apiclient'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.7

repositories {
    mavenCentral()
}

dependencies {
    compile 'org.codehaus.groovy:groovy-all:2.3.11'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'com.google.guava:guava:18.0'
    compile 'org.java-websocket:Java-WebSocket:1.3.0'
}
group 'emby.apiclient'
version '1.0-SNAPSHOT'

apply plugin: 'java'

sourceCompatibility = 1.7

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'org.codehaus.groovy:groovy-all:2.3.11'
    testCompile group: 'junit', name: 'junit', version: '4.11'
    compile 'com.google.code.gson:gson:2.5'
    compile 'com.mcxiaoke.volley:library:1.0.16'
    compile 'com.squareup.okhttp:okhttp:2.1.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
    compile 'emby.apiclient:apiclient:1.0-SNAPSHOT'
}
rootProject.name = 'apiclient'
include 'android'
findProject(':android')?.name = 'emby.apiclient.android'

在/android build.gradle文件中,您需要将
编译项目(“:apiclient”)
添加到依赖项列表中。我发现IntelliJ的“是否要向类路径添加依赖项”对话框只将其添加到.iml文件中,而该文件不是作为构建的一部分运行。

在/android build.gradle文件中,您需要将
编译项目(“:apiclient”)
添加到依赖项列表中。我发现IntelliJ的“是否要将依赖项添加到类路径”对话框只将其添加到.iml文件中,而该文件不是作为构建的一部分运行的。

您不是在gradle中管理依赖项吗,您可以显示build.gradle文件吗?已使用build.gradle文件更新。您需要在settings.gradle文件中包含子项目,以便gradle现在正在构建多项目构建。这两个项目都列在settings.gradle.appclient.android中,是这样命名的文件夹吗?你不是在gradle中管理依赖关系,你能显示你的build.gradle文件吗?用build.gradle文件更新。你需要在settings.gradle文件中包含你的子项目,以便gradle现在正在构建一个多项目构建。两个项目都列在settings.gradle中。什么是
appclient.android
,它是这样命名的文件夹吗?