Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why am I getting error message "URI is not Registered"?

Tags:


I just installed Android Studio and everything ran fine but then I opened AS for a second time after my computer had turned off and I am getting the following error:

"URI is not Registered"

On the following lines of code:

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

This is just the manifest, but it's happening on all of my XML files with that link. I've searched Stack and found nothing that solves my issue.

like image 551
Andrew Quebe Avatar asked Dec 13 '13 15:12

Andrew Quebe


2 Answers

Maybe this is because it's not the main Manifest.xml, but the debug Manifest.. Try editing app/src/main/Manifest..

like image 119
YosefBro Avatar answered Oct 12 '22 14:10

YosefBro


I had this issue when creating alternate resources for different app "flavors". I used the built-in Image Asset Generator to do everything (both folder and image generation), so I was fairly certain it was not due to an error that I had made.

When switching "flavors" in the Build Variants pane in Android Studio, the unused res folder (meaning, from the variant/"flavor" that is NOT active) gets a plain folder icon as opposed to the "res" folder icon.

So any res XML files in that currently inactive folder cannot anymore be processed as res files because Android Studio temporarily doesn't know that this is a res folder - until you switch variants and the same thing happens to the other variant's res files.

The solution is to create an almost empty manifest file in each flavor's root folder as I described in my answer here: https://stackoverflow.com/a/63224818/5916188. Somehow, this makes Android Studio realize that this is actually a res folder despite that it's not the active variant and therefore currently inactive.

For example, if you have a flavor called "pro", right-click on the pro folder then choose new * other * Android Manifest File. Do the same for any other flavors, too.

My "dummy" AndroidManifest.xml file in each flavor contains only:

<manifest>
    <application/>
</manifest>
like image 24
Sam Avatar answered Oct 12 '22 15:10

Sam