intellij在android xml文件中说“找不到声明”

时间:2021-02-06 09:34:00

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

当我在themes_holo.xml(Android系统的文件)中找到声明时,Intellij告诉我:

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>

4 个解决方案

#1


4  

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

我有同样的问题,这是为我修复的问题:

  1. close the project in intellij.
  2. 在intellij关闭项目。

  3. close intellij.
  4. go to the project folder and delete the .idea folder
  5. 转到项目文件夹并删除.idea文件夹

  6. restart intellij and open the project (wait for the indexing to finish) and it would work.
  7. 重新启动intellij并打开项目(等待索引完成),它会工作。

#2


0  

I already met this problem yesterday,but it isn`t absolutely similar to yours, and I searched nothing for help.Finally I resoved this by myself. Here is my XML file:

我昨天已经遇到了这个问题,但它与你的问题并不完全相似,我没有寻求任何帮助。最后我自己给了这个。这是我的XML文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#ff0d17ff"
tools:ignore="HardcodedText"
tools:context=".MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world"
    android:background="#ff0d17ff"/>

When I try to click the word "HardcodeText", it tells me "cannot declaration to go to", and it tells me that "checks references injected by IntelliLang plugin".

当我尝试单击“HardcodeText”这个词时,它告诉我“无法声明去”,它告诉我“检查IntelliLang插件注入的引用”。

The problem comes from the XML settings,here`s my Android studio settings find this: editor-Inspections:searching xml,and you find this:Android-Android Resources Validation ,check it,and you will find Unknow Android XML attribute,check it

问题来自XML设置,这里是我的Android工作室设置找到这个:editor-Inspections:搜索xml,你会发现:Android-Android Resources验证,检查它,你会发现Unknow Android XML属性,检查它

editor-Intentions:find XML-Set Namespace Prefix to empty,check this there will no warning line tell you checks references injected by IntelliLang plugin.and "cannot declaration to go to" because it quotes the official DTD or other thing,just ignore it if there is no warning line.

editor-Intentions:找到XML-Set Namespace Prefix为空,检查一下这里没有警告线告诉你检查IntelliLang插件注入的引用和“无法声明去”,因为它引用官方DTD或其他东西,只需忽略它如果没有警告线。

#3


0  

I had the same problem, I used following steps:

我遇到了同样的问题,我使用了以下步骤:

  1. Go to File
  2. 转到文件

  3. Select Power save mode option
  4. 选择省电模式选项

  5. Disable the power save mode
  6. 禁用省电模式

This is worked for me and for suggestion.

这对我有用,也有建议。

#4


0  

idea.max.intellisense.filesize = 99999

idea.max.intellisense.filesize = 99999

adding the above line in idea.properties solved the issue

在idea.properties中添加上述行解决了这个问题

#1


4  

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

我有同样的问题,这是为我修复的问题:

  1. close the project in intellij.
  2. 在intellij关闭项目。

  3. close intellij.
  4. go to the project folder and delete the .idea folder
  5. 转到项目文件夹并删除.idea文件夹

  6. restart intellij and open the project (wait for the indexing to finish) and it would work.
  7. 重新启动intellij并打开项目(等待索引完成),它会工作。

#2


0  

I already met this problem yesterday,but it isn`t absolutely similar to yours, and I searched nothing for help.Finally I resoved this by myself. Here is my XML file:

我昨天已经遇到了这个问题,但它与你的问题并不完全相似,我没有寻求任何帮助。最后我自己给了这个。这是我的XML文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="#ff0d17ff"
tools:ignore="HardcodedText"
tools:context=".MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world"
    android:background="#ff0d17ff"/>

When I try to click the word "HardcodeText", it tells me "cannot declaration to go to", and it tells me that "checks references injected by IntelliLang plugin".

当我尝试单击“HardcodeText”这个词时,它告诉我“无法声明去”,它告诉我“检查IntelliLang插件注入的引用”。

The problem comes from the XML settings,here`s my Android studio settings find this: editor-Inspections:searching xml,and you find this:Android-Android Resources Validation ,check it,and you will find Unknow Android XML attribute,check it

问题来自XML设置,这里是我的Android工作室设置找到这个:editor-Inspections:搜索xml,你会发现:Android-Android Resources验证,检查它,你会发现Unknow Android XML属性,检查它

editor-Intentions:find XML-Set Namespace Prefix to empty,check this there will no warning line tell you checks references injected by IntelliLang plugin.and "cannot declaration to go to" because it quotes the official DTD or other thing,just ignore it if there is no warning line.

editor-Intentions:找到XML-Set Namespace Prefix为空,检查一下这里没有警告线告诉你检查IntelliLang插件注入的引用和“无法声明去”,因为它引用官方DTD或其他东西,只需忽略它如果没有警告线。

#3


0  

I had the same problem, I used following steps:

我遇到了同样的问题,我使用了以下步骤:

  1. Go to File
  2. 转到文件

  3. Select Power save mode option
  4. 选择省电模式选项

  5. Disable the power save mode
  6. 禁用省电模式

This is worked for me and for suggestion.

这对我有用,也有建议。

#4


0  

idea.max.intellisense.filesize = 99999

idea.max.intellisense.filesize = 99999

adding the above line in idea.properties solved the issue

在idea.properties中添加上述行解决了这个问题