Description
When using the following code, the camera fails to open and I get the following error log. This looks to be a regression from 8.2.0.GA
[ERROR] TiMedia: (main) [122857,122924] Failed to create file: Permission denied
[DEBUG] DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@701a6fd[TiActivity]
[INFO] { code: 2, error: 'Unable to create file for storage', success: false }
[INFO] error, womp womp
const win = Ti.UI.createWindow();
win.addEventListener('click', _ => {
Ti.Media.requestCameraPermissions(e => {
if (!e.success) {
console.warn('Failed to get permissions.');
return;
}
Ti.Media.showCamera( {
success(e) {
console.log(e);
},
cancel(e) {
console.warn(e);
},
error(e) {
console.error(e);
},
saveToPhotoGallery: true,
mediaTypes: [ Ti.Media.MEDIA_TYPE_PHOTO ]
});
})
});
win.open();
Steps to reproduce
1. Add the code above to an existing app.js
2. Build to Android
Actual
Above error log
Expected
Camera should open
This looks to be the same as TIMOB-26273 but it works on 8.2.0.GA for me and is broken on 8.3.0.GA so filed a new ticket
master: https://github.com/appcelerator/titanium_mobile/pull/11490
*FR: Pass* *Test Environment* SDK Ver: 8.3.1.GA & 9.0.0.GA & 9.1.0(this PR) OS Ver: 10.14.6 Appc NPM: 5.0.0 Appc CLI: 8.0.0 Daemon Ver: 3.2.0 Node Ver: 10.17.0 Java Ver: 1.8.0_162 Emulators: Android 5.1 (API 22) & Android 10 (API 29) PR merged.
*Closing ticket.* Fix verified in SDK version 9.1.0.v20200401121418. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11490