未找到在编译时的IntelliJ模块包 [英] Module packages not found at compile time in IntelliJ

查看:130
本文介绍了未找到在编译时的IntelliJ模块包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在的IntelliJ设置我的Andr​​oid项目。我以前从未使用过它,我有一些问题,模块的依赖关系。

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检测他们(即有在code无投诉),但它不能在编译时用包某某不存在。我也曾尝试检查出口的模块,但似乎没有任何效果。

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.

推荐答案

试着增加你的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

下面是我已经添加了谷歌播放SRC作为一个模块的可视化。

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

这篇关于未找到在编译时的IntelliJ模块包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆