[AC-5351] Load external libraries and SDK with appcelerator hyperloop
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Needs more info |
Resolution Date | 2017-11-30T21:41:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Hyperloop |
Labels | hyperloop |
Reporter | Sandro Lain |
Assignee | Shak Hossain |
Created | 2017-11-07T10:01:02.000+0000 |
Updated | 2017-11-30T21:41:38.000+0000 |
Description
I'm working on a iOS and Android DVR app with remote controls.
I need to use a third-party library for network communication and video encoding, via hyperloop programming.
At the moment I tried importing the iOS version libraries.
The library consists of a static file libDVR_NET_SDK.a and a "include" folder with several .h header files inside.
I followed the official documentation ad copy the files into folder /app/platform/ios without creating the appc.js file (documentation report that is deprecated).
I can not understand how to call the external library from javascript code, at the moment I tried:
var libDVR_NET_SDK = require("libDVR_NET_SDK");
But the following error is generated with simulator:
[ERROR] : Script Error Couldn't find module: libDVR_NET_SDK for architecture: x86_64
Or on device:
[ERROR] : Script Error Couldn't find module: libDVR_NET_SDK for architecture: arm64
Hello [~sandrolain], Thanks for sharing with us. Check [Modules inTitanium ](https://docs.appcelerator.com/platform/latest/#!/guide/CommonJS_Modules_in_Titanium). Please make sure the module is included in the tiapp.xml and to be rebuilt with 64-bit support. Please follow the steps, test in latest SDK and let us know how it goes.
Hello What I'm trying to import is not a titanium module but a pre-compiled native library given by our vendor hrough hyperloop.
You need to require the actual headers, not the static library itself. Also, it looks like a C++ library, which types are not fully supported in Hyperloop, yet. In that case, you may want to wrap the API's using a native module (create a new one with
appc ti create -t module
).[~sandrolain], Did you manage to follow [~hknoechel] 's instructions?
I'm trying to create a module that incorporates the code and native libraries I have been provided, but I do not have much experience with creating native modules.
Hello, you need to build a module to support your C++ library with Appcelerator. Currently, hyperloop does not fully support that. There is a guide on how to get started with Android module in Appcelerator, http://docs.appcelerator.com/platform/latest/#!/guide/Android_Module_Project. Thanks.
Hello [~sandrolain], I just wanted to follow up here. Did you manage to follow the instructions provided earlier? Let us know if you still experience any issue. We would be happy to assist you. Best Regards!