I got this error from yet another reason:
I had the file res/xml/data.xml
and I was trying to load it with Resources
class like this:
Resources.getSystem().getXml(R.xml.data);
However this is incorrect as the method Resources.getSystem()
returns a global shared Resources object that provides access to only system resources.
The correct way is as follows (from inside Activity):
this.getResources().getXml(R.xml.data);