Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26273] Android: saveToPhotoGallery throws an error if there is no external storage.

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.3.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterJosh Longton
AssigneeJoshua Quick
Created2018-08-07T16:29:36.000+0000
Updated2020-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

  1. Joshua Quick 2018-08-07

    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.
  2. Pietro Granati 2018-10-05

    Any news? This bug is HUGE!

JSON Source