Android Studio:解析 XML 时出错 &URI 未注册 [英] Android Studio: Error parsing XML & URI is not registered

查看:36
本文介绍了Android Studio:解析 XML 时出错 &URI 未注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向我的项目添加新活动后,我在编译布局时出现以下错误

<块引用>

Gradle:解析 XML 时出错:格式不正确(令牌无效)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"机器人:方向=垂直"><文本视图android:layout_width="wrap_content"android:layout_height="wrap_content"android:id="@+id/tv_password"android:text="<密码>"/></LinearLayout>

"来自这个问题 实际上解决了我的问题.

总结:

转到文件>项目结构>模块",单击添加",然后单击android"和应用/确定".这应该可以解决任何遇到类似问题的人,但此问题的评论对您没有帮助.

After adding a new Activity to my project I get following error while compiling the layout

Gradle: Error parsing XML: not well-formed (invalid token)

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical" >

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tv_password"
        android:text="<password>"/>
</LinearLayout>

"http://schemas.android.com/apk/res/android" is marked red and hovering pops following message up

URI is not registered ( Setting | Project Settings | Schemas and DTDs )

My Settings>Project Settings>Schemas and DTDs look like that:

I already found some similar questions around here but nothing helped me to solve this issue. I hope someone has an idea... :)

解决方案

I was having a similar issue. However, the comments did not assist me in the solution to this issue. This answer from this question actually solved my problem.

Summary:

Go to "File > Project Structure > Modules", click "add" and then click "android" and "apply/ok". That should solve anyone having a similar problem but the comments for this question are not helping you.

这篇关于Android Studio:解析 XML 时出错 &amp;URI 未注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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