Tyler Treat
Tyler Treat

Reputation: 14998

Module packages not found at compile time in IntelliJ

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.

Upvotes: 10

Views: 10605

Answers (1)

Aaron McIver
Aaron McIver

Reputation: 24713

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.

enter image description here

Upvotes: 12

Related Questions