Vasco Costa
Vasco Costa

Reputation: 341

PhoneGap 1.3 to 1.5 upgrade

I have an application for Android using phonegap 1.3.0 and was trying to update to 1.5 (Cordova).

I switched the .jar file, the XML file, and the JS file, and the application builds fine.

But when I run the application and try to access the FileSystem it fires an error with code 5 (FileError.ENCODING_ERR, supposedly).

If I run the Eclipse project which has the 1.3 version, I have no problem at all.

Upvotes: 1

Views: 354

Answers (1)

will.quast
will.quast

Reputation: 29

I think this is a bug in Android's Cordova 1.5.

FileUtils.java:161 assumes that the arg[1] is a file name not a full path. But if you look at cordova-android-1.5.0.js:2360 they are passing the path as the second arg, for which you probably provided something like "file:///mnt/sdcard/somefile.data". So when this path is given to FileUtils.java:129 as a filename, it fails the check on line 640, and throws a EncodingException. To fix it, make sure you send the fileName and not a path or URL.

Upvotes: 1

Related Questions