找不到XML和命名空间中的Android Studio未知属性 [英] Android Studio Unknown attribute in xml and Namespace not found

查看:78
本文介绍了找不到XML和命名空间中的Android Studio未知属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Layout和清单文件中收到此警告. 我已在下面附加了这些图像,请仔细检查以确保进一步澄清.

I recently got this warning in Layout and manifest files. I have attached those images below just check those in case for further clarification.

问题是我正在获得命名空间",但没有受到警告,并且我无法对android studio中通常使用的xml文件使用自动完成代码.请对此问题提供帮助. 每个Android属性都会显示未知的xml属性警告.

The problem is I'm getting Namespace " is not bound warning and I cannot use the autocomplete code for xml files which can be generally used in android studio.Please help for this issue. The unknown xml attribute warning is displayed for each and every android attribute.

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent"

              >
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/blue"

            >
    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="text"
        android:textColor="@android:color/white"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_margin="10dp"
        android:layout_above="@+id/editText"
        android:layout_alignLeft="@+id/editText"
        android:layout_marginBottom="15dp"/>
    <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:inputType="number"
            android:ems="15"
            android:padding="10dp"
            android:id="@+id/editText" android:layout_gravity="center"
            android:layout_centerInParent="true"
            android:background="@color/white"/>
    </RelativeLayout>

</RelativeLayout>

推荐答案

这很简单.删除.caches文件:

It is very simple. Delete .caches file:

  1. 只需关闭您的AS.
  2. 转到.AndroidStudio3.2文件夹.
  3. 删除缓存文件(路径为:C:\Users\user\.AndroidStudio3.2\system)
  4. 重新启动您的AS.
  5. 享受.
  1. Just close your AS.
  2. Go to .AndroidStudio3.2 folder.
  3. Delete the Caches file (path is: C:\Users\user\.AndroidStudio3.2\system)
  4. Restart your AS.
  5. Enjoy.

这篇关于找不到XML和命名空间中的Android Studio未知属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆