Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23446] Hyperloop: iOS: Error when built with TiCore

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-05-30T08:53:40.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsHyperloop, iOS
Labelsqe-5.4.0
ReporterChee Kiat Ng
AssigneeChee Kiat Ng
Created2016-05-27T07:14:04.000+0000
Updated2016-07-01T22:04:14.000+0000

Description

Steps to reproduce

1. using the latest timob master and the latest hyperloop master. (see my env ^) 2. *appc new --classic* 3. install hyperloop module. configure tiapp.xml accordingly:
  <modules>
    <module platform="iphone">hyperloop</module>
  </modules>
  <plugins>
    <plugin>hyperloop</plugin>
  </plugins>
4. write this in app.js https://gist.github.com/hansemannn/3ea14512f894bc507a5cea57336b7f77 5. *appc run -p ios*

Expected Result

App builds normally and shows 2 colored squares

Actual Result

red screen of death. as attached. If you include
  <ios>
    <use-jscore-framework>true</use-jscore-framework>
  </ios>
it will work. if you set to false, same red screen of death.

Attachments

FileDateSize
Simulator Screen Shot 27 May 2016, 3.04.21 PM.png2016-05-27T07:14:36.000+0000161408

Comments

  1. Chee Kiat Ng 2016-05-30

    PR here: https://github.com/appcelerator/hyperloop.next/pull/33

    Steps to test

    1. build this hyperloop module ./build.sh 2. install it 3. *appc new --classic* 4. in tiapp.xml, have
         <modules>
           <module platform="iphone">hyperloop</module>
         </modules>
         <plugins>
           <plugin>hyperloop</plugin>
         </plugins>
       
    5. use this in app.js
       var UIAlertController = require('UIKit/UIAlertController'),
           UIAlertAction = require('UIKit/UIAlertAction'),
           UIAlertControllerStyleAlert = require('UIKit').UIAlertControllerStyleAlert,
           UIAlertActionStyleDefault = require('UIKit').UIAlertActionStyleDefault,
           TiApp = require('Titanium/TiApp');
       
       var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(
           'My Title',
           'My Message',
           UIAlertControllerStyleAlert
       );
       
       var alertAction = UIAlertAction.actionWithTitleStyleHandler('OK', UIAlertActionStyleDefault, function () {
       });
       
       alertController.addAction(alertAction);
       
       var win = Ti.UI.createWindow({
         backgroundColor: 'white'
       });
       
       var btn = Ti.UI.createButton({
         title: 'press me'
       });
       
       
       btn.addEventListener('click', function(e){
         TiApp.app().showModalController(alertController, true);
       });
           
       win.add(btn);
       win.open();
       
    6. *appc run -p ios*

    Expected Result

    It will run successfully. You can tests more cases by setting this property as well: false
  2. Chee Kiat Ng 2016-05-30

    The change is inspired by this: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf where by our ticore lib actually doesn't recognise "setPrototypeOf" so we Polyfill instead. The solution is unfortunately not the most elegant, as i'm directly writing code in the template file. [~jhaynie] Since we know where the problem lies, can you propose a better way to resolve it and i'll investigate? Thanks.
  3. Josh Longton 2016-07-01

    I was unable to reproduce the issue with the steps and environment provided above. 5.4.0.v20160519143319 did not allow me to build the project. *There was no error or "Red screen of death" present.* Tested on:
 iPhone 6s Plus (9.3.1) iOS Simulator (9.3) 
Mac OSX El Capitan 10.11.5 Studio: 4.7.0.201606220541 
Ti SDK: 5.4.0.v20160629063537 
Appc NPM: 4.2.7-2 Appc CLI: 5.4.0-23 
Xcode 7.3.1 Node v4.4.4 *
Closing Ticket.*

JSON Source