Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intellij say "cannot find declaration to go to" in android xml file [duplicate]

When I find the declaration in themes_holo.xml(a Android system's file), Intellij tell me :

cannot find declaration to go to

Here is the code mentioned:

<style name="Theme.Holo.Light.Dialog">
    <item name="windowFrame">@null</item>
    <item name="windowTitleStyle">@style/DialogWindowTitle.Holo.Light</item>
    ...
    <!-- I wang to find declaration of PreferencePanel.Dialog -->
    <item name="preferencePanelStyle">@style/PreferencePanel.Dialog</item>
</style>
like image 664
HalfLike Avatar asked Dec 14 '14 15:12

HalfLike


People also ask

How do you fix Cannot find declaration to go to in IntelliJ?

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.

How do you fix Cannot find declaration to go to in PyCharm?

The solution for me: remember to add an interpreter to the project, it usually says in the bottom right corner if one is set up or not. Just an alternate solution than the others. This happened after reinstalling PyCharm and not fully setting up the ide.


1 Answers

I had the same problem, here is what fixed it for me:

  1. close the project in intellij.
  2. close intellij.
  3. go to the project folder and delete the .idea folder
  4. restart intellij and open the project (wait for the indexing to finish) and it would work.
like image 72
timmy_stapler Avatar answered Oct 12 '22 03:10

timmy_stapler