Module packages not found at compile time in IntelliJ

送分小仙女□ 提交于 2019-12-06 20:19:13

问题


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.

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.


回答1:


Try adding your src as modules.

  • 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

Here is a visual where I have added the Google Play src as a module.



来源:https://stackoverflow.com/questions/14086704/module-packages-not-found-at-compile-time-in-intellij

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!