[TIMOB-24198] Hyperloop: iOS - API availability annotation parsed incorrectly
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-03-16T13:50:25.000+0000 |
| Affected Version/s | Hyperloop 2.0.0 |
| Fix Version/s | Hyperloop 2.0.1 |
| Components | Hyperloop, iOS |
| Labels | qe-hyperloop |
| Reporter | Jan Vennemann |
| Assignee | Jan Vennemann |
| Created | 2016-12-06T01:32:09.000+0000 |
| Updated | 2017-03-16T17:17:08.000+0000 |
Description
The Hyperloop metabase is missing classes annotated with a of
API_AVAILABLE and API_UNAVAILABLE and which are not explicitly including the Foundation framework.
For example the the INPreferences class of the new Intents framework is annotated with API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(macosx) and won't be processed by the metabase parser.
*Steps to reproduce the behavior*
1. Create a new hyperloop enabled application with appc new -t app
2. Make a require to the INPreference class: var INPreferences = require('Intents/INPreferences');
3. Run the app with appc run -p ios
*Actual behavior*
The following error is thrown:
[ERROR] Script Error Couldn't find module: /hyperloop/intents/inpreferences for architecture: x86_64
*Expected behavior*
The app launches without errors.
*Additional notes*
The issue is solved by explicitly requiring the Foundation framework, forcing it to be included during metabase generation.
PR (master): https://github.com/appcelerator/hyperloop.next/pull/114 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/115
Reopening ticket, the issue reproduces on latest 2.0.1, so something happened after the code-review in February.
The new code generator introduced in TIMOB-23907 was unintentionally excluding classes that were required but never used, like in the test case for this ticket. The following PR fixes this issue: PR (master): https://github.com/appcelerator/hyperloop.next/pull/135 PR (2_0_X): https://github.com/appcelerator/hyperloop.next/pull/136
Verified as fixed, The error above in no longer thrown when requiring to the intents such as INPreference. Tested on: {noformat} macOS Sierra 10.12.3 iPhone 6 (10.2.1) iOS simulator (10.2, 10.0) Ti SDK: 6.0.3.v20170315154238 Hyperloop: 2.0.1 Appc CLI: 6.1.0 Appc NPM: 4.2.9-1 Node v4.6.0 {noformat} *Closing Ticket.*