4

I open an older project which has a normal Android 2.2 external library registered. I want to use Google maps and I change the external library to Android 2.2 Google APIs. After that I cannot parse the manifest file and I get an error:

AnroidManifest.xml
Error: Cannot parse file

The error is on the 2nd line in the URI

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

If I hover the error, I get the message: URI is not registered.

What's even more weird, when I return an old lilbrary to the project (a normal 2.2), I still have the same error.

What could be the reason for this?

PS. The IDE I use is IntelliJ IDEA.

Ollie C
  • 28,313
  • 34
  • 134
  • 217
sandalone
  • 41,141
  • 63
  • 222
  • 338

5 Answers5

8

Try IDEA 10.5 EAP, it has improved Android support and easier SDK configuration. File | Invalidate caches may also help.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
1

Make sure you only have lower caps characters in the path to the file.

Kai Friis
  • 75
  • 1
  • 7
1

Unfortunatelly, I couldn't find the solution to this issue and, so far, the only way to solve is to create a new project with correct external libraries and to copy files into it.

sandalone
  • 41,141
  • 63
  • 222
  • 338
  • Maybe you had this issue? http://stackoverflow.com/questions/5624620/cannot-find-package-value-in-androidmanifest-xml-for-module – CrazyCoder Apr 28 '11 at 17:29
  • It's not my issue (unfortunatelly). I do not have problem neither with the `package` nor nor with manifest location. My problem is in `xmlns:android` just like I said on the first place. – sandalone Apr 29 '11 at 13:33
  • AddOn: I even tried to disregard this error (alt+enter and then clicked on the suggested option), and now I do not have an error with `xmlns:android`, but rather a new error saying: "Error: Cannot parse file" and the `Manifest` tag is underlined in red. – sandalone Apr 29 '11 at 13:36
0

In IDEA 12 at least, Preferences > Schemas and DTDs, press the + to add External Schemas and DTDs, in the URI edit field add "http://schemas.android.com/apk/res/android", press OK to save. This was a little flaky, I had to do it twice, but it worked, the error is gone.

Sofi Software LLC
  • 3,879
  • 1
  • 36
  • 34
0

You should maybe check the configuration of your modules. Be sure to mark the relevant folders as "Sources", "Test Sources" or "Excluded".

I had a namespace warning in res/anim/fade_in.xml. When I marked the resource folder of my project as "Sources" as shown in the screenshot the namespace errors disappeared.

IntelliJ Modules Settings

JJD
  • 50,076
  • 60
  • 203
  • 339