Titanium JIRA Archive
Appcelerator Community (AC)

[AC-5360] Swift framework

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2017-11-12T12:07:33.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsHyperloop
Labelsios
ReporterIgor Stojanovic
AssigneeShak Hossain
Created2017-11-08T19:36:50.000+0000
Updated2019-05-28T13:48:57.000+0000

Description

1. Created simple swift framework testFr.framework. Framework is tested from other test Xcode project and it works. 2. Pasted testFr.framework to app/platform/ios directory 3. Required for framework class from index.js file. var MyView = require("testFr/MyView"); // this line is passed and "something is created" Ti.API.info("CLASS ", MyView); // this MyView object has value : var view = new MyView(); // FAILED $.index.add(view); 4. Get this error: [ERROR] : Cannot find class with name: MyView [ERROR] : Script Error { [ERROR] : column = 32; [ERROR] : description = "Cannot find class with name: MyView"; [ERROR] : line = 101; [ERROR] : message = "Cannot find class with name: MyView"; [ERROR] : name = ClassNotFound; [ERROR] : nativeStack = "1 libobjc.A.dylib 0x0000000184a84528 objc_exception_throw + 56\n2 testHyperloop 0x0000000102b66e74 testHyperloop + 4337268\n3 testHyperloop 0x0000000102b600d0 testHyperloop + 4309200\n4 testHyperloop 0x000000010295663c testHyperloop + 2172476\n5 testHyperloop 0x00000001029fc2dc testHyperloop + 2851548\n6 testHyperloop 0x0000000102a02218 testHyperloop + 2875928"; [ERROR] : sourceURL = "file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/hyperloop/testfr/myview.js"; [ERROR] : stack = "createProxy@[native code]\n$initialize@file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/hyperloop/testfr/myview.js:101:32\nMyView@file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/hyperloop/testfr/myview.js:24:14\nController@file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/alloy/controllers/index.js:1:1199\ncreateController@file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/alloy.js:1:4894\nglobal code@file:///var/containers/Bundle/Application/9683EB85-028C-46DD-8552-5A340974E8ED/testHyperloop.app/app.js:1:574"; [ERROR] : } 5. Checked file myView.js generated by hyperloop and it crash at this line: $class = Hyperloop.createProxy({ class: 'MyView', alloc: false, init: 'class' });

Attachments

FileDateSize
testHyperloop.zip2017-11-08T19:35:32.000+000010054419

Comments

  1. Hans Knöchel 2017-11-10

    [~jvennemann] Can you try to reproduce this? Thanks!
  2. Hans Knöchel 2017-11-12

    Pure Swift framework (without the public Objective-C header) are not supported so far. They require a different way of parsing and are tracked in TIMOB-24163.
  3. Richard Lustemberg 2019-01-15

    I'm having a similar issue with GiphyCoreSDK, a Swift framework which has a public objective C header.
  4. Hans Knöchel 2019-01-15

    [~rlustemberg] If you're flexible, you can use the pure native Swift module support coming in SDK 8 (already merged and stable) to even use frameworks that do not have any Obj-C relation.
  5. Richard Lustemberg 2019-01-15

    I'll test with SDK 8. In any case the GiphyCoreSdk is just a wrapper for an http client to their REST API. I can even skip the framework altogether, and use the Ti http client. But I'll test with SDK 8 anyway. The framework does work if I call it from within a native module (SDK 7.5), there are no issues once I import the umbrella header.
  6. Richard Lustemberg 2019-01-15

    It fails as well :( . The classes on the umbrella header are not available to hyperloop
  7. Hans Knöchel 2019-01-15

    Please note that I don't mean Hyperloop and SDK 8. I mean a native module (ti create -t module) where you can select "Swift" or "Obj-C" now.
  8. kosso 2019-05-28

JSON Source