The reason IntelliJ couldn't find declarations was that the subprojects were not built. After investigating why subprojects were not built, I found out that using "auto-import" was breaking the subprojects. After importing the project from build. gradle without auto-import, it worked for me.
Choose Navigate | Go to Declaration in the main menu, press F12 , or click the symbol while holding the Ctrl key.
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Project Settings | Modules. Select the necessary module and then open the Sources tab in the right-hand part of the dialog. Click Add Content Root and specify the folder that you want to add as a new content root. ).
I had this same problem, and @AniaG's solution in the comments worked for me.
src
folderI faced the same issue and spent almost 15-16 tiring hours to clean, rebuild, invalidate-cache, upgrade Idea from 16.3 to 17.2, all in vain. We have a Maven managed project and the build used to be successful but just couldn't navigate between declaration/implementations as Idea couldn't see the files.
After endlessly trying to fix this, it finally dawned to me that it's the IDEA settings causing all the headache. This is what I did (Windows system):
.iml
files from project directory del /s /q "C:\Dev\trunk\*.iml".idea
folders<user_home>\.IntelliJIdea2017.2\system
VOILAAAAAAAAAAAA...!! I hope this helps a poor soul in pain
I had the same issue with idea and I was trying to open a maven project but the pom files where not identified. So right clicking on the pom file and choosing "add as maven project" did all the magic for me :)
Had the same problem. But only on my own methods.
Just fixed it by invalidating cache: (File-> Invalidate Caches/Restart)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With