[TIMOB-26273] Android: saveToPhotoGallery throws an error if there is no external storage.
GitHub Issue | n/a |
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.3.0 |
Fix Version/s | n/a |
Components | Android |
Labels | n/a |
Reporter | Josh Longton |
Assignee | Joshua Quick |
Created | 2018-08-07T16:29:36.000+0000 |
Updated | 2020-02-17T11:39:33.000+0000 |
Description
*Steps to reproduce*
Create an android application with the testcase below
Build to android device
Click open camera
*Testcase*
{noformat}
function askCameraPermissions() {
if (Ti.Media.hasCameraPermissions()) {
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var button = Ti.UI.createButton({
top: 10,
title: "open camera"
});
button.addEventListener("click", function() {
Titanium.Media.showCamera({
success: function(event) {
Ti.API.info("***************** woop");
},
cancel: function() {
Ti.API.info("***************** cancel");
},
error: function(error) {
Ti.API.info("***************** error");
},
saveToPhotoGallery: true,
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]
});
});
win.add(button);
win.open();
} else {
Ti.Media.requestCameraPermissions(function(e) {
if (e.success === true) {
Ti.API.info("Camera Permissions Granted");
} else {
alert("Access denied, error: " + e.error);
}
});
}
}
askCameraPermissions();
{noformat}
*Error*
{noformat}
[ERROR] TiMedia: (main) [678,3423] Failed to create external storage directory.
[INFO] ***************** error
{noformat}
*Expected*
No error is thrown and the camera is opened
Comments
JSON Source
I suspect this issue will happen if the device does not have external storage mounted. Such as a device removable storage. I don't think setting "saveToPhotoGallery" to true/false is a factor.
Any news? This bug is HUGE!