Android Studio: Error parsing XML & URI is not reg

2019-01-18 02:26发布

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: Settings>Project Settings>Schemas and DTDs

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

7条回答
你好瞎i
2楼-- · 2019-01-18 02:58

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.

查看更多
登录 后发表回答