# Using frameworks

**URL:** https://talk.remobjects.com/t/using-frameworks/15430
**Category:** Elements
**Tags:** fire
**Created:** [February 6, 2018, 1:09pm UTC](https://talk.remobjects.com/t/using-frameworks/15430 "2018-02-06T13:09:46Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 6, 2018, 1:09pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/1 "2018-02-06T13:09:47Z")

</div>

Is it possible yet to use a Framework that was developed in Obj-C? I’m looking at using this [https://github.com/kontaktio/kontakt-ios-sdk](https://github.com/kontaktio/kontakt-ios-sdk) from this beacon company [https://developer.kontakt.io/ios-sdk/quickstart/installation/](https://developer.kontakt.io/ios-sdk/quickstart/installation/) and would obviously prefer to do the job with Fire.

I want to build an iOS and Android app to detect beacons.

---

<div class="post-metadata">

### Author: ![JohnMoshakis](https://talk.remobjects.com/user_avatar/talk.remobjects.com/johnmoshakis/32/2286_2.png) [@JohnMoshakis](https://talk.remobjects.com/u/JohnMoshakis)
#### Post date: [February 6, 2018, 1:19pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/2 "2018-02-06T13:19:08Z")

</div>

Yes.

Ive been using train and headerimporter

[https://docs.elementscompiler.com/Tools/HeaderImporter/](https://docs.elementscompiler.com/Tools/HeaderImporter/)

This is a train script to import purelayout

```
var hi = "/Users/JohnMoshakis/Documents/Elements/HeaderImporter.exe";
var fxBaseFolder = '/Users/JohnMoshakis/Documents/Elements/Toffee SDKs'; // where the SDK .fx files are
var developerFolder = '/Applications/Xcode.app/Contents/Developer';

include("../HeaderImporter/generate.train");

iOSSdkVersion="11.2" ; // optionally, pick a target SDK

processiOSFramework({
    framework: "/Users/JohnMoshakis/Documents/develop/TrainScripts/PureLayout/Debug-iphoneos/PureLayout.framework",
    link: [],
    destinationFolder: "/Users/JohnMoshakis/Documents/develop/TrainOutput"
});
```

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 6, 2018, 1:23pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/3 "2018-02-06T13:23:24Z")

</div>

Reminds me, I should add the import option for this to Fire’s Tools|FXGen menu, sometime soon.

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 6, 2018, 1:27pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/4 "2018-02-06T13:27:17Z")

</div>

That would be awesome, that one would be good to test it on! I’m going to look at the iOS one first, android later ([https://developer.kontakt.io/android-sdk/quickstart/](https://developer.kontakt.io/android-sdk/quickstart/)).

In the meantime, I’ll look at John’s suggestion.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 6, 2018, 1:28pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/5 "2018-02-06T13:28:57Z")

</div>

Yeah, I’ll see if I can add that this week, should be straight-forward, given that the Xcode import one is already integrated.

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 9, 2018, 4:32pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/6 "2018-02-09T16:32:58Z")

</div>

I see it didn’t get into today’s build, am I right in thinking that I need to build train with VS, or can I do that with Fire too? I just tried with today’s and it didn’t build (failed on GenerateResources) so I’m guessing I’ll have to go the windows route?

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 9, 2018, 4:39pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/7 "2018-02-09T16:39:11Z")

</div>

You can build Train in Fire too. or use the Train.exe that ships inside fire. (the UI just barely didn’t make it, need rot do more tweaks/testing before I can enable it, hopefully for next week)

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 9, 2018, 4:39pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/8 "2018-02-09T16:39:41Z")

</div>

> [@jeremy](#):
>
> I just tried with today’s and it didn’t build (failed on GenerateResources)

That’s xbuild for you. buggy. Use EBuild.

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 9, 2018, 4:43pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/9 "2018-02-09T16:43:34Z")

</div>

> [@mh](#):
>
> That’s xbuild for you. buggy. Use EBuild.

Ah yes, ta. Forgot I’d flipped that. That did it.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 9, 2018, 4:44pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/10 "2018-02-09T16:44:22Z")

</div>

Shame on you 😉

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 9, 2018, 4:51pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/11 "2018-02-09T16:51:23Z")

</div>

> [@mh](#):
>
> Shame on you

In my defence, it was when something worked but didn’t on EBuild. My current project doesn’t build in the latest though. I’ll log it.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 9, 2018, 5:06pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/12 "2018-02-09T17:06:40Z")

</div>

> [@jeremy](#):
>
> In my defence, it was when something worked but didn’t on EBuild.

How short ago was that? I chnaged the setting that controls EBuild vs XBuild just a few weeks back (so that EBuild would default to true anew for anyone who turned it on and back off in the past), bunt didn’t recall any EBuild specific reports from you since…

> [@jeremy](#):
>
> My current project doesn’t build in the latest though. I’ll log it.

yeah, that one’s not an EBuild bug. At this stage EBuild is more solid then xbuild in all cases i’m aware of.

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 9, 2018, 5:27pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/13 "2018-02-09T17:27:53Z")

</div>

> [@mh](#):
>
> How short ago was that? I chnaged the setting that controls EBuild vs XBuild just a few weeks back (so that EBuild would default to true anew for anyone who turned it on and back off in the past), bunt didn’t recall any EBuild specific reports from you sinc

Ages ago. I don’t recall changing it recently.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 9, 2018, 6:56pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/14 "2018-02-09T18:56:17Z")

</div>

> [@jeremy](#):
>
> Ages ago. I don’t recall changing it recently.

weird, then. I’ll double-check which settings it reads, again…

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 13, 2018, 4:06pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/15 "2018-02-13T16:06:21Z")

</div>

I gave it a go, but am getting an error during the import, so perhaps I should wait for the import option to be added, unless you can guess what this may be?

```
      function doProcessLibrary([object Object]) {
        folder.create(/Users/Jeremy/Documents/Elements/TrainOutput/KontaktSDK/iOS/armv7-apple-ios) { }
        function runHeaderImporterForLibrary([object Object], --fxpaths "/Users/Jeremy/Documents/Elements/Toffee SDKs/iOS 11.2" --copyframework) {
          import --architecture=armv7-apple-ios -o "/Users/Jeremy/Documents/Elements/TrainOutput/KontaktSDK/iOS/armv7-apple-ios" -f "/Users/Jeremy/Documents/BitBucket/kontakt-ios-sdk/KontaktSDK/iOS" --importframework=KontaktSDK --type=ios --fxpaths "/Users/Jeremy/Documents/Elements/Toffee SDKs/iOS 11.2" --copyframework -q objc/NSObject.h:Foundation -q objc/NSObjCRuntime.h:Foundation
          shell.exec(/Users/Jeremy/Documents/Elements/HeaderImporter.exe import --architecture=armv7-apple-ios -o "/Users/Jeremy/Documents/Elements/TrainOutput/KontaktSDK/iOS/armv7-apple-ios" -f "/Users/Jeremy/Documents/BitBucket/kontakt-ios-sdk/KontaktSDK/iOS" --importframework=Konta...) {
            Failed with error code: 1
            Output:

```

Unhandled Exception:  
System.TypeLoadException: Could not load type ‘HeaderImporter.CodeGen’ from assembly ‘HeaderImporter, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null’.  
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type ‘HeaderImporter.CodeGen’ from assembly ‘HeaderImporter, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null’.

```
            Error calling Process.Execute: Failed with error code: 1

```

System.Exception: Failed with error code: 1  
at RemObjects.Train.API.Shell.Exec (RemObjects.Script.EcmaScript.ExecutionContext ec, System.Object aSelf, System.Object[] args) [0x003b9] in :0  
} shell.exec(/Users/Jeremy/Documents/Elements/HeaderImporter.exe)  
} function runHeaderImporterForLibrary

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 13, 2018, 4:49pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/16 "2018-02-13T16:49:25Z")

</div>

> [@jeremy](#):
>
> I gave it a go, but am getting an error during the import, so perhaps I should wait for the import option to be added,

The Import UI will literally create and run the same script you’re running, so better we get this sorted out beforehand…

> [@jeremy](#):
>
> System.TypeLoadException: Could not load type ‘HeaderImporter.CodeGen’ from assembly ‘HeaderImporter, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null’.

Hmm, is that with a recent v10 build? sounds like a reference mismatch.

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 13, 2018, 5:09pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/17 "2018-02-13T17:09:11Z")

</div>

> [@mh](#):
>
> Hmm, is that with a recent v10 build? sounds like a reference mismatch.

I took everything from inside Fire (Train folder/headerimporter/generate.train/toffee sdks) as I assumed that was how it would work, plus installed the same mono as Fire has internally.

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 13, 2018, 5:20pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/18 "2018-02-13T17:20:21Z")

</div>

Ok, that’s fine. But a recent Fire, eg 2249 or 2251? It sounds like HeaderImporter.exe is missing some reference assemblies. Can you try if installing the matching external compiler fixed it?

---

<div class="post-metadata">

### Author: ![jeremy](https://talk.remobjects.com/user_avatar/talk.remobjects.com/jeremy/32/10_2.png) [@jeremy](https://talk.remobjects.com/u/jeremy)
#### Post date: [February 13, 2018, 5:39pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/19 "2018-02-13T17:39:15Z")

</div>

Yes, I tried both those builds actually, same result. External compiler. Ah. I notice in Fire that external elements was not found. Never needed it. Installed the same one all in 2251. Now it does something!

Went through lots of files, and failed with something it didn’t like:

> ```
> KTKDeviceAdvertisingPacketsKontaktTLM = 1 << 8,
> 
> ```

The last line that was good

> ```
> /**
> * All supprted Eddystone packets.
> */
> KTKDeviceAdvertisingPacketsEddystoneAll = (NSInteger)0b00000000000000000000000000011100,
> /**
> * All supprted Eddystone Secure (EID + ETLM).
> */
> KTKDeviceAdvertisingPacketsEddystoneSecure = (NSInteger)0b00000000000000000000000001100000,
> /**
> * All supprted packets.
> */
> KTKDeviceAdvertisingPacketsAll = (NSInteger)0b11111111111111111111111111111110
> };
> 
> ```

This is the part it stopped at, error below:

======  
An error occurred: HeaderImporter.ParserException: KontaktSDK/KTKDeviceDefinitions.h (141:62 pp: 11099) closing brace expected; current token: Identifier (b00000000000000000000000000011100)  
Surrounded by:  
at HeaderImporter.CParser.RaiseError (System.String aError) [0x00136] in :0  
at HeaderImporter.CParser.Expect (HeaderImporter.TokenKind aToken) [0x00022] in :0  
at HeaderImporter.CParser.ParseEnum (HeaderImporter.CType aPrev) [0x00266] in :0  
at HeaderImporter.CParser.ParseType (System.Boolean aAllowQualifier, System.Boolean aAnyIdent) [0x008af] in :0  
at HeaderImporter.CParser.ParseDeclSpec (System.Boolean aOpt, System.Boolean aAllowStorageClass) [0x0061f] in :0  
at HeaderImporter.CParser.ParseDeclaration (System.Boolean aAllowFunction, System.Action`1[T] aAddToParent, System.Boolean aALlowIn) [0x00036] in :0  
at HeaderImporter.CParser.Parse () [0x00054] in :0  
at HeaderImporter.Import.DoImportWithState (System.String aFileName) [0x003fb] in :0

```
            Error calling Process.Execute: Failed with error code: 1

```

System.Exception: Failed with error code: 1  
at RemObjects.Train.API.Shell.Exec (RemObjects.Script.EcmaScript.ExecutionContext ec, System.Object aSelf, System.Object args) [0x003b9] in :0  
} shell.exec(/Users/Jeremy/Documents/Elements/HeaderImporter.exe)  
} function runHeaderImporterForLibrary  
} function doProcessLibrary  
} function processLibrary  
} function processiOSDeviceLibrary

---

<div class="post-metadata">

### Author: ![mh](https://talk.remobjects.com/user_avatar/talk.remobjects.com/mh/32/18050_2.png) [@mh](https://talk.remobjects.com/u/mh)
#### Post date: [February 13, 2018, 6:17pm UTC](https://talk.remobjects.com/t/using-frameworks/15430/20 "2018-02-13T18:17:18Z")

</div>

That’s a HI bug for Carlo. Can you send me the .framework?

[Next page](https://talk.remobjects.com/t/using-frameworks/15430.md?page=2)
