I’m using the plist library to load a plist file: http://code.google.com/p/plist/
I’m using code like so:
//InputStream ins = getResources().openRawResource(R.raw.skillsanddrills)
InputStream ins = getResources().openRawResource(R.xml.skillsanddrills); //file name is skillsanddrills.plist
NSDictionary rootDict;
try {
rootDict = (NSDictionary)PropertyListParser.parse(ins);
...
However I’m getting:
java.lang.UnsupportedOperationException: The given data is neither a
binary nor a XML property list. ASCII property lists are not
supported.
I don’t believe this is the libraries fault because I got a similar error using another plist library and the file itself is just a plan XML struture. Why would Android be changing my plist files?
Any ideas on how to fix this?
The library also accepts files instead of streams. But can’t work out how to create the file path to the file.
This should be the source code where it is crashing:
Maybe you should put your plist not in
xmlbut therawfolder and load it like that:If that fails put it in
assetand load it like that:If that fails than your plist might be simply wrong formatted.