在IntelliJ中在编译时找不到模块包

编程入门 行业动态 更新时间:2024-10-24 06:31:03
本文介绍了在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中在编译时找不到模块包

本文发布于:2023-11-16 13:01:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1604512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   模块   IntelliJ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!