[TIMOB-11240] iOS: App crashes on changing orientation while opening photogallery from modal window
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-10-08T23:43:30.000+0000 |
| Affected Version/s | Release 2.1.3 |
| Fix Version/s | Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20 |
| Components | iOS |
| Labels | api, media, qe-ios090112, qe-review, qe-testadded |
| Reporter | Shyam Bhadauria |
| Assignee | Vishal Duggal |
| Created | 2012-10-03T11:24:37.000+0000 |
| Updated | 2019-07-24T10:41:45.000+0000 |
Description
This is not a regression. It exists as far as 2.0.1.
This seems to be an ipad issue. It works fine on iPHONE 3G S(iOS 5.0.1) and iPhone 4S(iOS 5.1)
Steps to reproduce
1. Use the app below in app.js
var win = Ti.UI.createWindow();
win.modal = true;
var button = Titanium.UI.createButton({
title: "Push me"
});
button.addEventListener('click', function() {
Titanium.Media.openPhotoGallery({
});
});
win.add(button);
win.open();
2. Run the app and press button 'Push me'
3. Rotate the device to different orientation now.
Expected result
2. After step 2, the photo gallery should get displayed.
3. App should rotate to different orientations without crash.
Actual result:
2. After step 2, the photo gallery is not displayed.
3. App crashes on rotating to different orientation.
Attachments
| File | Date | Size |
|---|---|---|
| timob11240 10-3-12 9-32 AM.crash | 2012-10-03T16:36:01.000+0000 | 32225 |
Able to reproduce. Attached Crash log. Console output:
Oct 3 09:32:23 iPad-3-iOS-6 timob11240[395] <Warning>: [DEBUG] Reading stylesheet from: /var/mobile/Applications/71ACBBA2-9B3A-435C-BEAB-9369B8C6EEDE/timob11240.app/stylesheet.plist Oct 3 09:32:23 iPad-3-iOS-6 timob11240[395] <Warning>: [INFO] timob11240/1.0 (2.1.3.v20121002110115.7882ce1) Oct 3 09:32:23 iPad-3-iOS-6 timob11240[395] <Warning>: [DEBUG] Analytics is enabled = YES Oct 3 09:32:23 iPad-3-iOS-6 timob11240[395] <Warning>: [DEBUG] Loading: /var/mobile/Applications/71ACBBA2-9B3A-435C-BEAB-9369B8C6EEDE/timob11240.app/app.js, Resource: app_js Oct 3 09:32:24 iPad-3-iOS-6 timob11240[395] <Warning>: [DEBUG] Application booted in 183.185995 ms Oct 3 09:32:24 iPad-3-iOS-6 timob11240[395] <Warning>: Unbalanced calls to begin/end appearance transitions for <TiRootViewController: 0x1c54bd30>. Oct 3 09:32:56 iPad-3-iOS-6 timob11240[395] <Warning>: [ERROR] The application has crashed with an unhandled exception. Stack trace: 0 CoreFoundation 0x38af82a3 <redacted> + 162 1 libobjc.A.dylib 0x35f1f97f objc_exception_throw + 30 2 CoreFoundation 0x38af81c5 <redacted> + 0 3 UIKit 0x39b8526f <redacted> + 502 4 timob11240 0x00125469 timob11240 + 705641 5 Foundation 0x35452a6f <redacted> + 450 6 CoreFoundation 0x38acd5df <redacted> + 14 7 CoreFoundation 0x38acd291 <redacted> + 272 8 CoreFoundation 0x38acbf01 <redacted> + 1232 9 CoreFoundation 0x38a3eebd CFRunLoopRunSpecific + 356 10 CoreFoundation 0x38a3ed49 CFRunLoopRunInMode + 104 11 GraphicsServices 0x384d12eb GSEventRunModal + 74 12 UIKit 0x397ee301 UIApplicationMain + 1120 13 timob11240 0x0007c629 timob11240 + 13865 14 timob11240 0x0007bfe8 timob11240 + 12264 Oct 3 09:32:56 iPad-3-iOS-6 timob11240[395] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:]: Popovers cannot be presented from a view which does not have a window.' *** First throw call stack: (0x38af82a3 0x35f1f97f 0x38af81c5 0x39b8526f 0x125469 0x35452a6f 0x38acd5df 0x38acd291 0x38acbf01 0x38a3eebd 0x38a3ed49 0x384d12eb 0x397ee301 0x7c629 0x7bfe8) Oct 3 09:32:56 iPad-3-iOS-6 ReportCrash[398] <Notice>: Formulating crash report for process timob11240[395] Oct 3 09:32:56 iPad-3-iOS-6 com.apple.launchd[1] (UIKitApplication:com.appcelerator.timob11240[0xd02c][395]) <Warning>: (UIKitApplication:com.appcelerator.timob11240[0xd02c]) Job appears to have crashed: Abort trap: 6Comment out "win.modal = true;" and the app does not crash.
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3104
Use this code for testing Every app should have a base window. Trying to open app directly from a model window is an unsupported behavior.
var win = Ti.UI.createWindow({backgroundColor:'blue'}); win.addEventListener('focus',function(){ var modalwin = Ti.UI.createWindow({backgroundColor:'yellow',navbarHidden:false}); modalwin.modal = true; var button = Titanium.UI.createButton({ title: "Push me" }); button.addEventListener('click', function() { Titanium.Media.openPhotoGallery({}); }); modalwin.add(button); modalwin.open(); }); win.open();Closing as fixed. Tested and verified on: Titanium Studio, build: 3.0.0.201210220122 Titanium SDK, build: 3.0.0.v20121025171611 Device: iPad 2G (4.3.5)