URI is not registered ( Setting | Project Settings | Schemas and DTDs ) 解决方案

问题出现描述:

For me this was because I was using a debug and release build variant. I added the new folders src/debug/res/layout/some_layout.xml file manually, and it didn't recognize the URI. 

使用build variant的时候在src建了和main同级的目录,然后res/layout下面拷贝了一个main下面正常的布局文件。然后就在

[html]  view plain copy
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  2.     xmlns:tools="http://schemas.android.com/tools"  

上面两行报错了:

[html]  view plain copy 在CODE上查看代码片 派生到我的代码片
  1. URI is not registered ( Setting | Project Settings | Schemas and DTDs )  

解决方案:

1.I switched the build variant to release, and then back to debug. This caused AS to reload something, and the error went away.这个方案没试验过

2.浏览statckoverflow其他页面的时候有人说是这版本的bug,建议升级。我升级之后重启as问题就解决了。不过我感觉具体原因应该是第一种方案说的as现在有bug,没有reload一些资源造成的。

http://stackoverflow.com/questions/16883427/why-is-android-studio-reporting-uri-is-not-registered

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值