我尝试在IntelliJ中设置我的Android项目。我从来没有使用它,我有一些模块依赖的问题。
I'm attempting to setup my Android project in IntelliJ. I've never used it before, and I'm having some problems with module dependencies.
项目依赖于几个模块,我已经添加在依赖项选项卡。 IntelliJ检测它们(即在代码中没有投诉),但它在编译时失败,package x.y.z不存在。我也试过检查导出的模块,但这似乎没有效果。
The project depends on several modules, which I have added in the Dependencies tab. IntelliJ detects them (i.e. there are no complaints in the code), but it fails at compile time with "package x.y.z does not exist." I have also tried checking "export" for the modules, but that seems to have no effect.
我看到这个问题,似乎是同样的问题,但没有解决方案。
I saw this question which appears to be the same problem, but there was no solution.
推荐答案p>尝试将您的src添加为模块。
Try adding your src as modules.
- 文件>添加模块
- 来源 - > your_src_path_top_level
- 下一页>下一步>完成
- 文件>项目结构>模块> YourApp
- +按钮>模块依赖关系> your_lib_you_added_earlier
- 使用向上/向下箭头移动到列表的底部
- File > Add Module
- Create Module from Existing Sources -> your_src_path_top_level
- Next > Next > Finish
- File > Project Structure > Modules > YourApp
- plus button > Module Dependency > your_lib_you_added_earlier
- Use the up/down arrows to move to the bottom of the list
以下是我将Google Play src添加为模块的视觉效果。
Here is a visual where I have added the Google Play src as a module.
更多推荐
在IntelliJ中在编译时找不到模块包
发布评论