首页 > 解决方案 > xml 中的 Android Studio 建议未针对特定项目显示

问题描述

我正在使用 android studio 3.5.1 版,对于所有其他项目,它工作正常,但对于特定项目,xml 建议没有显示。我已经尝试过使缓存无效,删除.idea文件夹,但结果保持不变。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".xyz">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

标签: androidandroid-studio

解决方案


不久前我遇到了这个问题,并且能够按照以下步骤解决它;

  1. 关闭安卓工作室。
  2. 删除C:\Users\{MyUsername}\.AndroidStudio3.5\system\caches\目录的内容。
  3. 重新启动 Android Studio。

这应该让事情再次为你工作。我希望这会有所帮助!

注意:我在这里的回答是对我提供给类似问题的先前回答的轻微修改。我已经尝试了您在问题中提到的所有其他建议,但没有一个我在上面包含的建议似乎对我有用。


推荐阅读