Why am I getting error message “URI is not Registered”?

前端 未结 6 912
挽巷
挽巷 2020-12-16 12:07


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:

相关标签:
6条回答
  • 2020-12-16 12:12

    What fixed it for me is that those xml files were missing the header line...

    <?xml version="1.0" encoding="utf-8"?>
    

    Adding that fixed the problem.

    0 讨论(0)
  • 2020-12-16 12:13

    I had this problem! Turns out I was editing a drawable in the resources subfolder instead of the res subfolder.

    0 讨论(0)
  • 2020-12-16 12:14

    A funny solution since it reminds me of the Eclipse's good old days... I just had this issue and what solved it for me was simply restarting Android Studio

    0 讨论(0)
  • 2020-12-16 12:15

    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>
    
    0 讨论(0)
  • 2020-12-16 12:17

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

    0 讨论(0)
  • 2020-12-16 12:32

    I had the same problem. Click on the event log on the bottom right-hand corner. You should see a message saying "Android framework is detected in the project Configure". Then click the configure option.This solved the problem for me.

    0 讨论(0)
提交回复
热议问题