Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27503] iOS : Open an iPad Popover crash the app

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-11-12T10:05:27.000+0000
Affected Version/sRelease 8.2.1
Fix Version/sRelease 8.3.0
ComponentsiOS, iPad
LabelsengSchedule, ios, regression
Reporternicolomonili
AssigneeJan Vennemann
Created2019-10-25T09:44:43.000+0000
Updated2019-11-12T10:05:27.000+0000

Description

From SDK > 8.2.0.GA opening a Popover crash the app. Tested on iOS 11,12,13 simulator. With SDK 8.2.0.GA no problems. Code from http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iPad.Popover
var win = Ti.UI.createWindow({backgroundColor: 'white'});

var button = Ti.UI.createButton({title: 'Open Popover!'});
button.addEventListener('click', function(e){
    popover.show({ view: button });
})
win.add(button);

var rightButton = Ti.UI.createButton({title: 'Robin'});
rightButton.addEventListener('click', function(e){
    alert("But green's the color of spring.");
});

var contentWindow = Ti.UI.createWindow({
    rightNavButton: rightButton,
    title: 'Kermit'
});
contentWindow.add(Ti.UI.createLabel({text: "It's not easy being green."}));

var popover = Ti.UI.iPad.createPopover({
    backgroundColor: 'green',
    contentView: Ti.UI.createNavigationWindow({
        width: 250,
        height: 100,
        window: contentWindow
    })
});

win.open();

Comments

  1. Rene Pot 2019-10-25

    Using the latest 8.3.x build 8.3.0.v20190904053513 and CLI 7.1.1 I have not been able to reproduce this. However, on the latest master build 8.3.0.v20191023125529 it does crash with stacktrace below:
       [INFO]  *** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<UIPopoverPresentationController: 0x7fadf2f24250>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'
       [INFO]  *** First throw call stack:
       [INFO]  (
       [INFO]          0   CoreFoundation                      0x00007fff23baa1ee __exceptionPreprocess + 350
       [INFO]          1   libobjc.A.dylib                     0x00007fff50864b20 objc_exception_throw + 48
       [INFO]          2   UIKitCore                           0x00007fff46e1181b __66-[UIPopoverPresentationController presentationTransitionWillBegin]_block_invoke + 0
       [INFO]          3   UIKitCore                           0x00007fff46e1c4a7 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2604
       [INFO]          4   UIKitCore                           0x00007fff46e19cf9 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke.467 + 536
       [INFO]          5   UIKitCore                           0x00007fff47581d46 _runAfterCACommitDeferredBlocks + 352
       [INFO]          6   UIKitCore                           0x00007fff47572774 _cleanUpAfterCAFlushAndRunDeferredBlocks + 248
       [INFO]          7   UIKitCore                           0x00007fff475a2374 _afterCACommitHandler + 85
       [INFO]          8   CoreFoundation                      0x00007fff23b0c667 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
       [INFO]          9   CoreFoundation                      0x00007fff23b070fe __CFRunLoopDoObservers + 430
       [INFO]          10  CoreFoundation                      0x00007fff23b0777a __CFRunLoopRun + 1514
       [INFO]          11  CoreFoundation                      0x00007fff23b06e66 CFRunLoopRunSpecific + 438
       [INFO]          12  GraphicsServices                    0x00007fff38346bb0 GSEventRunModal + 65
       [INFO]          13  UIKitCore                           0x00007fff47578dd0 UIApplicationMain + 1621
       [INFO]          14  test                                0x000000010f99af8f main + 1215
       [INFO]          15  libdyld.dylib                       0x00007fff516ecd29 start + 1
       [INFO]          16  ???                                 0x0000000000000001 0x0 + 1
       [INFO]  )
       [INFO]  libc++abi.dylib: terminating with uncaught exception of type NSException
       
  2. Thomas Neerup 2019-10-29

    I'm on 8.2.1.GA and my app crashes like above when opening a Popover.. rendering 8.2.1.GA unusable for iPad development... Is there a workaround other than staying on 8.2.0.GA?
  3. Rene Pot 2019-10-29

    [~thomas.neerup@eg.dk] thanks for reporting, it indeed is broken on 8.2.1.GA now too (I can reproduce too).
  4. Jan Vennemann 2019-10-30

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/11303
  5. Lawrence Wilson 2019-11-01

    8.2.1.GA cannot be used at all for iPad releases as this is a fix in the TitaniumKit - what is the plan for getting this into 8.2?
  6. Jan Vennemann 2019-11-04

    [~lawrence.wilson@abannan.com], 8.3.0 RC is planned for start of this week. If you need to be unblocked immediately you can build your own 8.3.0 directly from the PR. You just need to run the following commands inside your local titanium_mobile repo:
       git checkout -b janvennemann-TIMOB-27503 master
       git pull https://github.com/janvennemann/titanium_mobile.git TIMOB-27503
       node build/scons.js cleanbuild ios
       
    This will build the SDK from sources and install it as 8.3.0
  7. Lokesh Choudhary 2019-11-06

    [~jvennemann], Is this PR ready for QE ?
  8. Jan Vennemann 2019-11-06

    [~lchoudhary], yup should be good to test. Maybe [~cwilliams] can do the CR since Vijay is still off for the week.
  9. Satyam Sekhri 2019-11-07

    FR Passed. Popover on iPad does not crash and works fine. Waiting on Jenkins build.
  10. Christopher Williams 2019-11-08

    merged to master
  11. Samir Mohammed 2019-11-11

    Verified fix in SDK version 8.3.0.v20191108110820. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11303
  12. Samir Mohammed 2019-11-12

    Closing ticket, also verified on SDK version 9.0.0.v20191111145151

JSON Source