为什么Android的工作室报告" URI未注册"? [英] Why is Android Studio reporting "URI is not registered"?

查看:646
本文介绍了为什么Android的工作室报告" URI未注册"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我已经给Android的工作室一试,因为我真的很喜欢ReSharper的,并注意到IDE有一些自己的功能内置到它。现在既然已经创建了一个默认的新项目,我添加了一个新的布局文件,并想改变现有的默认的'Hello World的例子布局了,我得到了一个URI未注册上以下行错误:

So I've given Android Studio a try, because I really like Resharper and noticed that the IDE had some of their functionality built into it. Having now created a default new project, I added a new layout file and wanted to change the existing default 'hello world' example layout, and I got an "URI is not registered" error on the following lines:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"

我什么也没做别的默认生成的项目呢。我遇到一个问题,这似乎是相关的(<一href="http://stackoverflow.com/questions/6147051/intellij-android-project-schema-uri-not-registered">Intellij Android项目架构URI没有注册?),只是忽略了一些奇怪的感觉对我来说。其实,我试了一下,但是这会导致 RelativeLayout的(也可能是所有其他Android相关的东西)将不承认任何更多的(错误信息:找不到元素的声明RelativeLayout的')。

I've done nothing else to the default generated project yet. I've come across another question that seems to be related (Intellij Android project schema URI not registered?), but just ignoring something feels odd to me. I actually tried it, but that causes RelativeLayout (and probably all other Android related stuff) to be not recognised any more (error message: "Cannot find the declaration of element 'RelativeLayout'").

在如何解决这个问题的任何想法?

Any ideas on how to solve this problem?

推荐答案

您是有这个问题,因为你是在错误的目的地!对于布局资源文件在正确的目录必须是在资源布局而不是资源 - 全布局

You are having this issue because you are at the wrong destination! The correct directory for the Layout resource file has to be under "res-layout" not "res-all-layout"

让我知道这是否解决了问题,你...好运气

Let me know if that solved the issue for you... good luck

这篇关于为什么Android的工作室报告&QUOT; URI未注册&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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