No grammar constraints (DTD or XML schema) detected for the document (Android) No grammar constraints (DTD or XML schema) detected for the document (Android) android android

No grammar constraints (DTD or XML schema) detected for the document (Android)


For me it was a Problem with character encoding and unix filemode running eclipse on Windows:

Just marked the complete code, cutted and pasted it back (in short: CtrlA-CtrlX-CtrlV) and everything was fine - no more "No grammar constraints..." warnings


I retrieve a solution from a bug issue :

  1. Click Window > Preferences > XML > XML Files > Validation
  2. Change the setting 'validating files'>'No grammar specified' from warning to ignore.
  3. Re-validate your project. No more warnings now.

It works for me.

Be careful, my solution is a kind of "I do not understand so that I prefer to deactivate"...


Solution For Eclipse:

add <!DOCTYPE something> to the begining of each problematic XML,

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

you can write anything for doctype, but basically it's supposed to be manifest, activity, etc. from what I understand