Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23722] Hyperloop: Classes that are unavailable on watchOS/tvOS are also not compiled on iOS

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-08-18T08:48:05.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.5.0, hyperloop 1.2.7
ComponentsHyperloop, iOS
Labelsn/a
ReporterHans Knöchel
AssigneeJan Vennemann
Created2016-08-03T20:00:04.000+0000
Updated2017-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

FileDateSize
hyperloop.zip2016-08-17T15:35:04.000+00002360110
Simulator Screen Shot 17.08.2016, 17.25.37.png2016-08-17T15:35:08.000+000076276
Simulator Screen Shot 17.08.2016, 17.32.43.png2016-08-17T15:35:08.000+000060867

Comments

  1. Francisco Ruaro Varisco 2016-08-17

    No news about this? I'm having the same issue.
  2. Jan Vennemann 2016-08-17

    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.
  3. Jan Vennemann 2016-08-17

    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.
  4. Hans Knöchel 2016-08-17

    PR approved and merged. I will bump the 1.2.7 then and publish the new release for QE
  5. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source