Imports are not working.

Answered

Hello,
I ran into an issue with my imports, I'm currently creating one of my projects which is dependend on another one.

In the project I'm working on, I'm trying to import classes and functions from others but they're not being found by the system, even though I can compile the whole project and it works perfectly fine. The classes are highlighted as red and as “Unresolved reference”… How can I fix it? 

I have to add that everything used to work when I was working on this project a few months ago, the issue started just in December and sometimes it fixes itself. It mainly comes back whenever I add the compiled file to the project again

-1
1 comment

How is the dependency on the other project configured exactly?

See if it helps to re-generate project configuration settings:

  1. Close the IDE, go to the project directory, backup and delete the entire .idea folder and any .iml files from its root
  2. In the IDE, go to File | New | Project from existing sources, select the project's source (root directory or main build file)
  3. Wait for indexing to finish

If it's a Maven project, try reloading the dependencies from the Maven tool window ('Refresh' circular arrows icon).

0

Please sign in to leave a comment.