我有以下目录结构:
D:\PROJECT +---javaGradleProject1 +---javaGradleProject2 +---javaGradleProject3 \---AndroidProject | build.gradle | settings.gradle \---AndroidModule build.gradle
Android模块依赖于与AndroidProject相同的根目录中的所有java gradle项目.
在AndroidProject / settings.gradle我有:
include ':AndroidModule' include 'javaGradleProject1' project(':javaGradleProject1').projectDir = new File(rootDir,'../javaGradleProject1') include 'javaGradleProject2' project(':javaGradleProject2').projectDir = new File(rootDir,'../javaGradleProject2') include 'javaGradleProject2' project(':javaGradleProject2').projectDir = new File(rootDir,'../javaGradleProject2')
然后在AndroidProject / AndroidModule / build.gradle我有这样的依赖关系:
compile project(':javaGradleProject1') compile project(':javaGradleProject2') compile project(':javaGradleProject3')
这种依赖的结构在调用时完全正常工作和项目构建
gradle build
在AndroidProject / build.gradle上.
但是当我尝试使IntelliJ与当前的渐变相关性设置同步时,我收到
Error: Unable to find module with Gradle path ':javaGradleProject1' Error: Unable to find module with Gradle path ':javaGradleProject2' Error: Unable to find module with Gradle path ':javaGradleProject3'
并且因为我的项目无法从运行配置运行(它不会在IDE中编译).我试图通过点击F4和模块依赖来手动添加这些依赖关系,但在同步之后,我的所有更改都被覆盖(实际上,IntelliJ只是删除它).
我的毕业生结构有什么问题吗?
我已经在IntelliJ IDEA 14.1.4和Android Studio 1.3上进行了测试.