android - 为什么 Android Studio 报告 "URI is not registered"?

标签 android android-studio

所以我尝试了 Android Studio,因为我非常喜欢 Resharper,并注意到 IDE 内置了一些功能。现在创建了一个默认的新项目,我添加了一个新的布局文件并想要更改现有的默认“hello world”示例布局,但在以下几行中出现“URI 未注册”错误:

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

我还没有对默认生成的项目做任何其他事情。我遇到了另一个似乎相关的问题( Intellij Android project schema URI not registered? ),但忽略某些东西对我来说很奇怪。我实际上尝试过,但这会导致 RelativeLayout(可能还有所有其他 Android 相关的东西)不再被识别(错误消息:“找不到元素'RelativeLayout' 的声明”)。

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

enter image description here

enter image description here

enter image description here

最佳答案

您遇到此问题是因为您位于错误的目的地!布局资源文件的正确目录必须在“res-layout”而不是“res-all-layout”下

关于android - 为什么 Android Studio 报告 "URI is not registered"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16883427/

相关文章:

android - 添加 fragment 后 BottomNavigationView 不在底部

android - 无法使用Jitpack编译 fork 的Github Repo

android - 如何在 Android Studio 3.0 中设置构建变体配置字段和资源值?

android jetpack 项目给出 archlifecycleversion 构建错误

java - 为什么使用 View 绘制 Canvas 会导致 NPE?

java - Android 上 ListView 的适配器滚动问题

java - Android 上的 NoClassDefFoundError

android - 如何在 Android 中根据区域设置和设备屏幕指定单个图像

android-studio - AndroidStudio Gradle错误: "Error:null value in entry: resOutputDir=null"

android - CardView onTouch onClick