Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24661] iOS: Hyperloop: keys[num].indexOf is not a function with a module

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-05-08T15:46:53.000+0000
Affected Version/sn/a
Fix Version/sBacklog
ComponentsiOS
Labelshyperloop, ios, module
ReporterBrian García
AssigneeEric Merriman
Created2017-05-05T05:37:17.000+0000
Updated2017-06-02T19:08:33.000+0000

Description

When trying to compile an Hyperloop enabled project, if there is my charts module present it crash with this error. See the attached Alloy project. It includes the build folder.

Attachments

FileDateSize
chartPoC.zip2017-05-05T05:36:59.000+00007782308

Comments

  1. Hans Knöchel 2017-05-05

    Hey Brian, thanks! But wait a second, didn't we have this in TIMOB-24547 as well (where you commented). I commented as well that it's resolved in 2.1.0 (as part of TIMOB-20274), so you are still getting it with 2.1.0?
  2. Brian García 2017-05-05

    Hi Hans, yes it still happens in 2.1.0 that's why I opened a new ticket I think it could be a different issue may be regarding the dynamic lib hook.
  3. Hans Knöchel 2017-05-05

    Ok, so * Is the issue is appearing when you use a native module together with Hyperloop? * Do you use any Hyperloop functionality (because I cannot see any)? * Will it work if you add one like a UILabel reference? * Does it work with other modules that do not have the dynamic-lib hook? * Can you attach the whole error-trace-log? * (Unrelated, personal) Why not just use the framework with CocoaPods in Hyperloop? Thanks :-)
  4. Brian García 2017-05-06

    Answering in order: * Yes, for me only happens with this module. * In other project yes, I made this demo project to see if there is any collision with some Hyperloop requires but it crashes just adding it to tiapp.xml * No, for the above reason. * Yes, I have other modules in the original projects and compiles and run perfectly. * the build log is inside the zip (if you need another one that there is in a different location just tell me the path I will upload it to a gist) I stated that there are some lines that doesn't show up in the build log:
       [DEBUG] Copying /Users/Brian/Documents/workspace/chartPoC/Resources/iphone/app.js => /Users/Brian/Documents/workspace
       /chartPoC/build/iphone/build/Products/Debug-iphonesimulator/chartPoC.app/app.js
       [ERROR] An error occurred during build after 7s 374ms
       [ERROR] keys[num].indexOf is not a function
       
    * Because the mpcharts is a swift pod and pod frameworks are not supported yet. Also because I want to test if there is a performance difference between Hyperloop and native module (in Android I think so, but I need to do more testing)
  5. Jan Vennemann 2017-05-08

    [~hansknoechel], the crash is caused by the ti.dynamiclib hook. It extends the Array prototype by just assigned the last property. This causes all arrays to have the iterable property last which causes the crash. To avoid that, the prototype extension should be defined like this:
       if (!Array.prototype.last) {
         Object.defineProperty(Array.prototype, 'last', {
           value: function() {
             return this[this.length - 1];
           }
         });
       }
       
  6. Hans Knöchel 2017-05-08

    Thanks Jan! Updated the library and released [1.0.1 on Github](https://github.com/appcelerator-modules/hook-embedded-frameworks/releases). Resolving issue ...
  7. Brian García 2017-05-08

    Confirmed as solved! Thank you!
  8. Lee Morris 2017-06-02

    Closing ticket as fixed.

JSON Source