【发布时间】:2014-09-22 13:36:45
【问题描述】:
我在 SO 中阅读了很多问题和答案,但没有任何运气。示例:Module packages not found at compile time in IntelliJ
问题是我有一个由以下人员组成的项目:
- 模块 A
- 模块 B
- 模块 C
模块 B 依赖于模块 A 和模块 C。
所以模块 B 中的导入代码就像
import com.moduleA.Fragment1;
import com.moduleA.Fragment2;
import com.moduleA.SomeInterface;
这些行在“编码时间”中正确导入,我可以正确使用这些类。
但是当我编译时,它崩溃了:
错误:(8, 32) 错误:com.moduleA 不存在
我已尝试将此模块 A 添加为 Android 库,但对我来说不行,因为 Android 需要生成常量字段 (http://tools.android.com/tips/non-constant-fields)。
我不知道还能做什么。
有什么建议吗?
【问题讨论】:
-
将项目上传到 github,包括所有 IntelliJ 配置文件会有所帮助...
标签: java android intellij-idea dependencies android-annotations