Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26705] iOS: Ti.App._restart() crashes application

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-01-09T18:42:06.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.0.0
ComponentsiOS
Labelsn/a
ReporterEwan Harris
AssigneeVijay Singh
Created2019-01-08T16:44:11.000+0000
Updated2019-01-09T18:42:10.000+0000

Description

Description

Calling the hidden Ti.App._restart(); method on iOS crashes with the below, this is bad as it's used in liveview to restart the app.
[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.
[ERROR] Reason:
[ERROR] -[TiRootViewController shutdownUi:]: unrecognized selector sent to instance 0x7fbee0023400
[ERROR] Stack trace:
[ERROR] 0   CoreFoundation                      0x00000001160651bb __exceptionPreprocess + 331
[ERROR] 1   libobjc.A.dylib                     0x0000000114e6f735 objc_exception_throw + 48
[ERROR] 2   CoreFoundation                      0x0000000116083f44 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
[ERROR] 3   UIKitCore                           0x0000000121f66b4a -[UIResponder doesNotRecognizeSelector:] + 287
[ERROR] 4   CoreFoundation                      0x0000000116069ed6 ___forwarding___ + 1446
[ERROR] 5   CoreFoundation                      0x000000011606bda8 _CF_forwarding_prep_0 + 120
[ERROR] 6   ticreateapp                         0x000000010f8804ae __22-[AppModule _restart:]_block_invoke + 94
[ERROR] 7   libdispatch.dylib                   0x000000011847c4e1 _dispatch_call_block_and_release + 12
[ERROR] 8   libdispatch.dylib                   0x000000011847d54b _dispatch_client_callout + 8
[ERROR] 9   libdispatch.dylib                   0x0000000118489380 _dispatch_main_queue_callback_4CF + 1290
[ERROR] 10  CoreFoundation                      0x0000000115fca3e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
[ERROR] 11  CoreFoundation                      0x0000000115fc4a76 __CFRunLoopRun + 2342
[ERROR] 12  CoreFoundation                      0x0000000115fc3e11 CFRunLoopRunSpecific + 625
[ERROR] 13  GraphicsServices                    0x000000011a5f31dd GSEventRunModal + 62
[ERROR] 14  UIKitCore                           0x0000000121f3881d UIApplicationMain + 140
[ERROR] 15  ticreateapp                         0x000000010f78d156 main + 950
[ERROR] 16  libdyld.dylib                       0x00000001184ed575 start + 1

Steps to reproduce

1. Add the code below to and app.js
var win = Ti.UI.createWindow();
win.addEventListener('click', function () {
    Ti.App._restart();
});
win.open()
2. Click the window

Actual

Above crash

Expected

App should restart back to the clean state

Comments

  1. Gary Mathews 2019-01-08

    master: https://github.com/appcelerator/titanium_mobile/pull/10582
  2. Keerthi Mahalingam 2019-01-08

    FR passed.Waiting for CR to merge.
  3. Gary Mathews 2019-01-08

    8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10587
  4. Christopher Williams 2019-01-09

    [~gmathews] Was this fixed by [~vijaysingh]'s fix for TIMOB-26694? Can we resolve/close it (since that was merged)?
  5. Christopher Williams 2019-01-09

    Fixed by [~vijaysingh] in his fix for the related TIMOB-26694. PRs were: PR (master) - https://github.com/appcelerator/titanium_mobile/pull/10593 PR (8_0_X) - https://github.com/appcelerator/titanium_mobile/pull/10594

JSON Source