wahid_abdul
wahid_abdul

Reputation: 156

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

Upvotes: 4

Views: 5379

Answers (3)

Stefa
Stefa

Reputation: 637

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.

Upvotes: 0

Agha Ali Abbas
Agha Ali Abbas

Reputation: 195

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

Upvotes: 1

Joseph El Khoury
Joseph El Khoury

Reputation: 516

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

Upvotes: 0

Related Questions