TLSphinx icon indicating copy to clipboard operation
TLSphinx copied to clipboard

Integrate TLSphinx without Carthage

Open randydalrymple opened this issue 6 years ago • 8 comments

Since the Carthage version does not run successfully on a device (Issue #24), I need the ability to edit the code and rebuild the project. Is there a straightforward way to add the project to my app workspace manually and rebuild it (outside of Carthage) after making changes?

Alternatively, is there a process to create a .framework from the edited code?

randydalrymple avatar May 02 '19 17:05 randydalrymple

I believe what you want to do is just get the code (cloning this repo), make any change you need and build it with Xcode. That will give you a framework you can drop inside your project.

What Carthage really does is just clone the repos and build them with Xcode cli.

BrunoBerisso avatar Jul 30 '19 11:07 BrunoBerisso

Thank you. I was able to build the framework in Xcode. I somehow expected it to be much more complicated. I noticed that the framework file from Carthage was much larger (5.4 MB) than the one from Xcode (636 KB), but the Carthage framework is fat and has all the hardware targets. Now I need to get the framework to work with my app.

randydalrymple avatar Jul 31 '19 02:07 randydalrymple

Yeah, that's pretty easy.Why isn't it working? Do you have an error? null

BrunoBerisso avatar Jul 31 '19 08:07 BrunoBerisso

I built the framework, but now I can't seem to integrate the newly-built framework into my project.

Originally, I incorporated TLSphinx in my project with Carthage and built it successfully.

Now I need to figure out how to edit and build TLSphinx with changes. I tried a couple different approaches:

(1) I cloned TLSphinx into a separate directory and built it, again successfully.

Since the source code had not changed between the Carthage build and the new build, I tried simply to copy the output files in Derived Data/TLSphinx to /Carthage/Build/iOS/. This resulted in an error stating that module.modulemap was duplicated.

Screen Shot 2019-08-01 at 7 29 58 PM

(2) Next, I copied the TLSphinx folder into my project folder and dragged TLSphinx.xcodeproj into my project:

Screen Shot 2019-08-01 at 8 03 12 PM

I added the framework to my project:

Screen Shot 2019-08-01 at 8 51 42 PM

It built correctly, but crashed on startup when the system couldn't find the framework:

"dyld: Library not loaded: @rpath/TLSphinx.framework/TLSphinx Referenced from: /var/containers/Bundle/Application/xxx-...-xxx/AppName.app/AppName Reason: image not found"

(Note: I didn't want to post a screenshot with a proprietary app name in it.)

I'm sure that there is something fundamental that I'm missing here. So, I'm asking:

(1) How does one insert TLSphinx into a project correctly? (2) Are there any scripts available to do this efficiently?

Thanks.

randydalrymple avatar Aug 02 '19 00:08 randydalrymple

Hello,

I have returned to this task and am trying from scratch to integrate TLSphinx directly. I did the following:

(1) I dragged the TLSphinx into my project.

Screen Shot 2019-08-27 at 1 56 24 PM

(2) I set the Header Search, Library Search, and Import paths correctly.

(3) I added TLSphinx.framework to Linked Frameworks and Libraries.

Screen Shot 2019-08-27 at 10 44 02 AM

(4) The project seems to build correctly and completely.

Screen Shot 2019-08-27 at 1 11 59 PM

However, I'm still getting a failure on Launch because the system can't find TLSphinx.framework.

Screen Shot 2019-08-27 at 12 51 02 PM

TLSphinx builds inside my project, and I can see the built framework in Finder. The overall project also builds without error. Yet, TLSphinx doesn't load. The only anomaly I can see is that the TLSphinx framework is missing from the Frameworks list in the navigation screen (left-side panel). However, it is clearly on the Embedded Frameworks and Libraries list.

Screen Shot 2019-08-27 at 10 43 03 AM

I'm sure that I'm missing one small detail somewhere, but it's not obvious what that is.

System Details:

MacOS Mojave 10.14.4 Xcode 10.3 iOS 12.4

I would greatly appreciate any help/guidance in solving this problem. Thanks.

Incidentally, Issue #45 provided a good roadmap for building the project.

Randy Dalrymple

randydalrymple avatar Aug 27 '19 18:08 randydalrymple

You need to go to project properties and check if image is actually embedded, see https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta

nshmyrev avatar Aug 27 '19 19:08 nshmyrev

Thank you. I will take a look.


From: Nickolay V. Shmyrev [email protected] Sent: Tuesday, August 27, 2019 3:17 PM To: tryolabs/TLSphinx [email protected] Cc: randydalrymple [email protected]; Author [email protected] Subject: Re: [tryolabs/TLSphinx] Integrate TLSphinx without Carthage (#57)

You need to go to project properties and check if image is actually embedded, see https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/tryolabs/TLSphinx/issues/57?email_source=notifications&email_token=AG4SGV7BGKPTBHDXLILOQOTQGV4UJA5CNFSM4HKB5EU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5I2NPI#issuecomment-525444797, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AG4SGV4P37WIMOSM3VNJFMDQGV4UJANCNFSM4HKB5EUQ.

randydalrymple avatar Aug 27 '19 20:08 randydalrymple

Thank you, Nickolay! The SO post explained quite a lot and resolved my problem. I can now build and run my project. I still have a couple smaller problems, but hopefully I can fix them without much trouble. I had not considered the differences between static and dynamic libraries before.

randydalrymple avatar Aug 28 '19 14:08 randydalrymple