[TIMOB-25392] iPad Crash: Taking a photo will cause app to crash after the first successful attempt
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2018-07-19T13:12:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | crash, ios, ipad, photo |
Reporter | Peter Ladis |
Assignee | Unknown |
Created | 2017-10-13T14:54:40.000+0000 |
Updated | 2018-07-19T13:12:33.000+0000 |
Description
Nothing special with my code...this is hit the first time and it works...the second..app crashes
Ti.Media.showCamera({
success: function(event) {
// called when media returned from the camera
Ti.API.info('Our type was: ' + event.mediaType);
if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
var photo = event.media;
if (photo != null) {
}
} else {
}
},
cancel: function() {
},
error: function(error) {
// called when there's an error
var a = Titanium.UI.createAlertDialog({
title: 'Camera'
});
if (error.code == Titanium.Media.NO_CAMERA) {
a.setMessage('Please run this test on device');
} else {
a.setMessage('Unexpected error: ' + error.code);
}
a.show();
},
saveToPhotoGallery: false,
allowEditing: false,
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]
});
Titanium SDK-version used? iOS version used? And does it work on the iPhone?
Here are my specs from build Operating System Name = Mac OS X Version = 10.12.6 Architecture = 64bit # CPUs = 8 Memory = 17179869184 Node.js Node.js Version = 4.8.4 npm Version = 2.15.11 Titanium CLI CLI Version = 5.0.14 Titanium SDK SDK Version = 6.2.2.GA SDK Path = /Users/pladis/Library/Application Support/Titanium/mobilesdk/osx/6.2.2.GA Target Platform = iphone ****Note after moving to ios11 and the new SDK...take photo was crashing on iPhone when i had the setting set to "Save to Phone" by taking that off...iphone works fine....but my users out in the field are complaining about iPad crashes
IOS is 9.3.5
The iOS 11 crash is because Apple requires the new key
NSPhotoLibraryAddUsageDescription
in addition toNSPhotoLibraryUsageDescription
in order to save photos to the gallery. Ti SDK 6.3.0 will throw a readable error log before Apple let's it crash. For the iOS 9.3.5 iPad crash, we'll try to reproduce it. And please add a crash trace-logSo I'm running on an actually device...it just stops tracing.. says application ended. Any other suggestions? I added this: NSPhotoLibraryAddUsageDescription but i have since turned off all saving to library feature. and the iPad is still crashing
Also...attaching a photo from library seems to work fine...its only taking a photo.
my users had not issue with 6.2.0 should i move the app back?
Thank you for the insight Peter! If it did not happen in 6.2.0, then that's even more interesting. If possible, are you able to see if it works in 6.2.1? I checked the underlaying code but it did not change anything related in Ti.Media, so it has to to something different to look into. *EDIT*: Both 6.2.1 and 6.2.2 did not change any iOS sources (only CLI-changes and Android-fixes). Are you sure 6.2.0 works fine? Also, does using Xcode 8 change the situation? Trying hard to troubleshoot this.
OK so i went back to 6.2.1 and it works. Moving to 6.2.0...first time i tried to take a picture it crashed....Same code..same device
Resolving as cannot reproduce, since our internal tests all passed and the kind of error suggests missing Info.plist permissions.