Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23665] [Hyperloop] iOS: custom class is not added to Xcode project and compiled if no other frameworks are being used in the project

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-07-29T22:58:35.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsHyperloop, iOS, Tooling
Labelsn/a
ReporterChris Bowley
AssigneeJan Vennemann
Created2016-07-20T19:12:01.000+0000
Updated2016-08-01T20:28:54.000+0000

Description

Creating a new project, enabling Hyperloop and adding a custom class does not work unless a Cocoa Touch framework is also referenced. Steps: * Create new project * Configure the project for Hyperloop * Add a custom Obj-C class 'MyClass', declare it in appc.js and require it in index.js controller Result: * MyClass metabase JS file is generated * MyClass is not added to the Xcode project and therefore not compiled * No build-time error, run time error Cannot find class with name: MyClass I have tracked down the cause: Custom classes and frameworks are added to the Xcode project in the plugin updateXcodeProject function. This function makes this check for content in this.nativeModules: https://github.com/appcelerator/hyperloop.next/blob/master/iphone/plugin/hyperloop.js#L672. this.nativeModules is populated here: https://github.com/appcelerator/hyperloop.next/blob/master/iphone/plugin/hyperloop.js#L574. I have attached an example project which demonstrates the error.

Attachments

FileDateSize
CustomClassTest.zip2016-07-20T19:11:57.000+000010475506

Comments

  1. Jan Vennemann 2016-07-28

    PR: https://github.com/appcelerator/hyperloop.next/pull/43 Thanks [~cbowley] for the detailed description of this issue! Really helped me to jump right in^^ Thanks to your demo project i was able to address a similar issue with swift files. The PR contains fixes for both issues.
  2. Chee Kiat Ng 2016-07-29

    CR and FT passed.

    Steps to test

    1. download the sample app 2. configure it accordingly to the correct version of hyperloop 3. *appc run -p ios -l trace*

    Expected result

    On the console, you will see [INFO] MyClass.hello(): hello and no errors.
  3. Wilson Luu 2016-07-29

    Reopening ticket. I do not see this fix in Ti SDK 5.4.0.v20160727143921. Looks like the fix went only into master branch.
  4. Hans Knöchel 2016-07-29

    [~wluu] Just to be ensure: The fix is part of the Hyperloop module, not the core SDK. So you need to replace the Hyperloop version with the latest hyperloop.next build (not in the releases tab, yet). Can you compile the module and test it from there? Otherwise, I would compile it for you on Monday.
  5. Wilson Luu 2016-07-29

    [~hansknoechel], My bad, misread the PR. But yes, I was able to verify the fix with the latest Hyperloop module 1.2.5. Will resolve ticket again, but won't close until Hyperloop 1.2.5 is released. Tested on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-37 Arrow: 1.8.2 SDK: 5.4.0.v20160727143921 Hyperloop: 1.2.5 Node: v4.4.7 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Device: iphone 6 simulator (9.3)
  6. Wilson Luu 2016-08-01

    Closing ticket as fixed. Verified that if I use the attached sample with Hyperloop 1.2.5, then I do not get the runtime error. Tested on: Appc CLI NPM: 4.2.7 Appc CLI Core: 5.4.0-37 Arrow: 1.8.2 SDK: 5.4.0.v20160801022303 Hyperloop: 1.2.5 Node: v4.4.7 OS: Mac OS X (10.11.6) Xcode: 7.3.1 Device: iphone 6 plus (9.1)

JSON Source