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

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

问题描述

我尝试在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中在编译时找不到模块包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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