简体   繁体   中英

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

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

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

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 :).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM