Wrong type for parameter "uri" of resolveLocalFileSystemURI: Expected String, but got Null

5.2k Views Asked by At

I am cureently trying to save a png image from my ionic(v1) application.This works well in android but I have errors in iOS.

The error is

ERROR: Wrong type for parameter "uri" of resolveLocalFileSystemURI: Expected String, but got Null.

I am using the cordova file plugin . I am sensing something is wrong with the folder path.

var folderpath=cordova.file.applicationStorageDirectory;

Thanks

3

There are 3 best solutions below

0
On

If anyone stumbles upon this question these days... The path is null when there is no user permission. Make sure you acquired correct permissions before trying.

0
On

Just use cordova.file.dataDirectory. I stored pdf's using this and it is working fine. Good luck!

0
On

You might be able to fix this issue by deleting your platforms folder, or the files inside, and do a 'platform add' afterwards.

Steps to reproduce:

  • ionic cordova platform remove ios (or android)
  • ionic cordova platform add ios (or android)

Following the steps above fixed the issue for me :).