[TIMOB-23722] Hyperloop: Classes that are unavailable on watchOS/tvOS are also not compiled on iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-08-18T08:48:05.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.5.0, hyperloop 1.2.7 |
Components | Hyperloop, iOS |
Labels | n/a |
Reporter | Hans Knöchel |
Assignee | Jan Vennemann |
Created | 2016-08-03T20:00:04.000+0000 |
Updated | 2017-03-31T22:15:54.000+0000 |
Description
The
CLBeaconRegion
class and others (TIMOB-2377) do not work. -We need the reason why only certain classes do not work and what their pattern is-. The problem is that classes that have the unavailable-macro for watchOS/tvOS during the metabase AST-analysis.
In detail, these two bad boys produce the problems:
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
So we need to check for them explicitly and only skip a class when __IOS_UNAVAILABLE
occurs.
Example:
var CLBeaconRegion = require("CoreLocation/CLBeaconRegion");
var NSUUID = require("Foundation/NSUUID");
var uuid = NSUUID.alloc().initWithUUIDString("B9407F30-F5F8-466E-AFF9-25556B57FE6D");
var region = CLBeaconRegion.alloc().initWithProximityUUIDMajorMinorIdentifier(uuid, 1, 1, "com.appcelerator.beacons");
*Expected behavior*: The initialization of the object works.
*Actual behavior*: The following log is thrown and the object is not initialized:
[ERROR] Script Error {
[ERROR] column = 42;
[ERROR] line = 12;
[ERROR] message = "undefined is not a function (evaluating 'CLBeaconRegion.alloc()')";
[ERROR] sourceURL = "file:///Users/hans/Library/Developer/CoreSimulator/Devices/765A790D-A9C5-4C7C-B3F7-15D024664D22/data/Containers/Bundle/Application/260A0F3D-2B17-4735-95ED-EBFB46671133/Hyperloop_Sample.app/alloy/controllers/beacons.js";
[ERROR] stack = "startDiscovery@file:///Users/hans/Library/Developer/CoreSimulator/Devices/765A790D-A9C5-4C7C-B3F7-15D024664D22/data/Containers/Bundle/Application/260A0F3D-2B17-4735-95ED-EBFB46671133/Hyperloop_Sample.app/alloy/controllers/beacons.js:12:42";
[ERROR]
Attachments
File | Date | Size |
---|---|---|
hyperloop.zip | 2016-08-17T15:35:04.000+0000 | 2360110 |
Simulator Screen Shot 17.08.2016, 17.25.37.png | 2016-08-17T15:35:08.000+0000 | 76276 |
Simulator Screen Shot 17.08.2016, 17.32.43.png | 2016-08-17T15:35:08.000+0000 | 60867 |
No news about this? I'm having the same issue.
Could someone please zip their hyperloop folder under the build directory and attach it to this issue? I'm trying to reproduce this but seeing another error regarding CLBeaconReagion at the moment and i would like to compare the generated files.
PR: https://github.com/appcelerator/hyperloop.next/pull/60 This fixes classes like CLBeaconRegion and UIStepper (TIMOB-23777) being unavailable in Hyperloop. Tested it with with the example given here, Hyperloop Examples Project and the environment described in this ticket. Since the error reported here is a little different from the one i was able to reproduce, this might need some more testing and verification.
PR approved and merged. I will bump the 1.2.7 then and publish the new release for QE
Closing ticket as fixed, if there are any problems, please file a new ticket.