Start a new topic

CaptureScreen in AppBundle problem in android

CaptureScreen in AppBundle problem in android


I was using a wrapper with ionic and i got some problem on capturing screen in Android...

//custom Date
var d = new Date();
var filepath = d.valueOf() + '_snapshot.jpg';
Ionicitude.captureScreen(false, filepath)
.then(function (absoluteFilePath) {
..success stuff
} ,
.catch({fail stuff})


it works in iOS but not in Android, it got open failed: EROFS (Read-only file system) error for using a custom filename...
Am i missing something? i have already included WRITE_EXTERNAL_STORAGE in permissions

Thank you for your help

The problem you are describing happens because the Android Cordova Plugin tries to save the screenshot file on the given path and since the path is only the filename it tries to store the image in the root directory which explains the EROFS.
This does not happen on iOS since there is a default directory set. Thank you for reporting this issue, we will take a look at it.

You could try to pass an absolute path to the screenshot to captureScreen in case of an android device as a temporary solution.

Best regards,
Andreas
 
Login or Signup to post a comment