Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27292] iOS: App crashes on startup on iOS 9

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2019-09-02T11:05:52.000+0000
Affected Version/sRelease 8.2.0
Fix Version/sRelease 8.2.0
ComponentsiOS
LabelsengSchedule, regression
ReporterEwan Harris
AssigneeEwan Harris
Created2019-07-29T15:08:34.000+0000
Updated2019-11-18T20:38:46.000+0000

Description

Description

When building to an iOS 9 simulator/device the app crashes on startup with the below, I believe this is due to the ios version change in [this commit](https://github.com/appcelerator/titanium_mobile/commit/8cac1f88cb226c36a4b9be6e4dee0beffda9b4ce#diff-09cce02f0aa7063f10a4c555dc65a141R23), as this is used to pass in the min iOS version to babel [here](https://github.com/appcelerator/titanium_mobile/blob/a48d707984e88e92f05287dcd3c2588025c9c9f2/build/lib/packager.js#L88) which means we're probably dropping some polyfills that are required. I'm not too sure why we have minIosVersion and a supported ios version range.
[ERROR] Script Error {
[ERROR]     line = 769;
[ERROR]     sourceURL = "file:///Users/eharris/Library/Developer/CoreSimulator/Devices/2A296A6B-E602-4231-9396-E35DDEBA2BB9/data/Containers/Bundle/Application/77BAC47A-6617-4AE4-B2C5-AE54D7C2C443/darkmodetesting.app/ti.main.js";

Steps to reproduce

1. Create a basic app, classic or alloy 2. Build the app to an iOS 9 simulator or device

Actual

App crashes on startup

Expected

App should not crash

Comments

  1. Ewan Harris 2019-07-29

    https://github.com/appcelerator/titanium_mobile/pull/11091
  2. Chris Barber 2019-07-29

    The problem is in the packager:
       const minSupportedIosSdk = version.parseMin(require(path.join(ROOT_DIR, 'iphone/package.json')).vendorDependencies['ios sdk']);
       
    In the Titanium iOS package.json, there are vendorDependencies.xcode and vendorDependencies\['ios sdk'\] as well as minIosVersion. The xcode property is the supported range of Xcode versions. This aligns with the "ios sdk" version range. The "ios sdk" version range is the supported range of iOS SDKs used to COMPILE the app, not run the app. The minimum "ios sdk" version is not the actual minimum version that the app will run on. The minIosVersion is the minimum iOS version the app will run on and is the default for the IPHONEOS_DEPLOYMENT_TARGET Xcode project setting. This is the version that Babel should be transpiling down to. So, the fix should be in the packager and the above line should be:
       const minSupportedIosSdk = require(path.join(ROOT_DIR, 'iphone/package.json')).minIosVersion;
       
  3. Ewan Harris 2019-07-29

    That was my understanding but tbh I just assumed we had some duplication :) I'll update my PR to update that code and the scons-xcode-project-build file that also incorrectly references that, but surely the point still stands that if that's a minimum for compiling then we cant bump that outside of a major version otherwise we'd be introducing a breaking change?
  4. Chris Barber 2019-07-29

    [~eharris] Correct, we cannot bump the minIosVersion or the Xcode and iOS SDK range minimum versions until 9.0.
  5. Satyam Sekhri 2019-08-19

    FR Passed. App builds and launches successfully on iOS 9 simulator
  6. Samir Mohammed 2019-09-02

    *Closing ticket*, fix verified in SDK version 8.2.0.v20190829124255. Also tested on an iOS 9 device and everything seems to run fine. Note* Improvement will be merged into 8_3_X at a later date. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/11091
  7. nicolomonili 2019-10-21

    There are still problems with *iOS 9* Test with *SDK8.3.0.v20191016161716 *
       /**
        * Create a new Ti.UI.TabGroup.
        */
       var tabGroup = Ti.UI.createTabGroup();
       
       /**
        * Add the two created tabs to the tabGroup object.
        */
       tabGroup.addTab(createTab("Tab 1", "I am Window 1", "assets/images/tab1.png"));
       tabGroup.addTab(createTab("Tab 2", "I am Window 2", "assets/images/tab2.png"));
       
       /**
        * Open the tabGroup
        */
       tabGroup.open();
       
       /**
        * Creates a new Tab and configures it.
        *
        * @param  {String} title The title used in the Ti.UI.Tab and it's included Ti.UI.Window
        * @param  {String} message The title displayed in the Ti.UI.Label
        * @return {String} icon The icon used in the Ti.UI.Tab
        */
       function createTab(title, message, icon) {
           var win = Ti.UI.createWindow({
               title: title,
               backgroundColor: '#fff'
           });
       
           var label = Ti.UI.createLabel({
               text: message,
               color: "#333",
               font: {
                   fontSize: 20
               }
           });
       
           win.add(label);
       
           var tab = Ti.UI.createTab({
               title: title,
               icon: icon,
               window: win
           });
       
           return tab;
       }
       
    Error: {quote}[ERROR] : Script Error { [ERROR] : column = 119; [ERROR] : line = 5633; [ERROR] : message = "undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(TypedArrayPrototype, Symbol.toStringTag).get')"; [ERROR] : sourceURL = "file:///var/containers/Bundle/Application/97D6BC75-49AF-46CC-A4C0-E6E25289FEBA/Test%20iOS%209.app/ti.main.js"; [ERROR] : stack = " at global code@file:///var/containers/Bundle/Application/97D6BC75-49AF-46CC-A4C0-E6E25289FEBA/Test%20iOS%209.app/ti.main.js:5633:119)"; [ERROR] : }{quote}
  8. Abir Mukherjee 2019-10-21

    [~smohammed] I noticed per your comment that the fix wasn't merged to 8.3.X right away. Do you know whether this has been merged yet to 8.3.X? If so, is the build that he's using, SDK8.3.0.v20191016161716, before the merge? cc:[~eharris]
  9. Abir Mukherjee 2019-10-21

    [~ahutton] can you please triage with the latest test case from Nicolo? We may have to reopen the ticket.
  10. Ewan Harris 2019-10-21

    [~amukherjee], Nicolo's comment is a separate issue to this ticket only present on 8.3.0, I opened TIMOB-27484 for that and am working on the fix.

JSON Source