2

I'm programming an Android app that uses Gradle. However, in the .xml files and Android Manifest, the URL for Android Schemas are "Not registered".

This problem has been a nuisance and have spent hours trying to get it fixed. I have looked through:

1: Intellij Android project schema URI not registered?

2: If I change an external library: AndroidManifest, cannot parse file

I cannot just create a new project because this application is not only developed only by me but a small team. The code is also on GitHub as well. Secondly, even if I try to create a new project, the Schemas are still not registered.

Eclipse is not an option because they do not officially support Gradle integration. (unless you have found a Gradle plugin that is SPECIFIC to android applications). I also have installed Android Studio, but I still get the same errors, if not more errors.

Edit: I am currently using Intelli-J community edition

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Do you have compilation errors? Have you tried same with Android Studio? – Eugen Martynov Jan 13 '14 at 07:06
  • Yes I have tried using Android Studio. I do get compilation errors, and it seems Gradle is the culprit. But I honestly think it would not solve the Schema not being registered. – ilovefruits Jan 14 '14 at 14:27
  • I've asked about Android studio usage because it is delegating build to gradle. So it is clear that errors not part of compilation process in IDEA. Since you're saying that this is compilation issue could you post your issued xml file and build.gradle file – Eugen Martynov Jan 14 '14 at 14:47
  • 3
    Did you find a solution for this? I am having the same problem, using IntelliJ Community Edition 13.1. I am using build flavors and for some reason the URI not registered error only appears for android layouts defined within the flavors and not in the rest of my project. I am losing hours and hours on this.... – idunno Mar 26 '14 at 17:00

3 Answers3

3

I had almost the same problem, 2 different flavors and that URI error in the xml files inside one of the flavors. I've solved by placing a copy of the Android Manifest inside the folder of the flavor that was giving me trouble, build project and error gone

Hernan Romero
  • 133
  • 10
1

For me the only thing worked was add mock Activity with right click on the Flavour package, choose "new->activity>empty activity", choose the fit source set and package name in the dialog, and after the Activity created the problem solved. I deleted the mock activity later and it not brought any problem.

yshahak
  • 4,996
  • 1
  • 31
  • 37
  • After deleting the dummy Activity, I would then delete its entry from the flavor-specific (NOT actual module) AndroidManifest.xml. – Sam Aug 03 '20 at 06:46
1

Combining both Hernan Romero's answer and yshahak's answer, create an Android Manifest file inside each flavor's root folder. For example, if you have a flavor called "pro", right-click on the pro folder then choose new * other * Android Manifest File.

(I did it the "long way": for each flavor, I set that flavor to be the active variant and then created a dummy empty activity with no layout file. I then removed the activity and unneeded xmlns: from the manifest and then deleted the activity and now-empty java folder in the flavor's folder. Rinse-repeat for the other flavor(s). That left me with an almost empty manifest, for each flavor, as follows:)

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

<manifest>
    <application/>
</manifest>
Sam
  • 1,009
  • 10
  • 13