Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate TLSphinx without Carthage #57

Open
randydalrymple opened this issue May 2, 2019 · 8 comments
Open

Integrate TLSphinx without Carthage #57

randydalrymple opened this issue May 2, 2019 · 8 comments

Comments

@randydalrymple
Copy link

randydalrymple commented May 2, 2019

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?

@BrunoBerisso
Copy link
Contributor

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.

@randydalrymple
Copy link
Author

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.

@BrunoBerisso
Copy link
Contributor

BrunoBerisso commented Jul 31, 2019 via email

@randydalrymple
Copy link
Author

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
Copy link
Author

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

@nshmyrev
Copy link

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

@randydalrymple
Copy link
Author

randydalrymple commented Aug 27, 2019 via email

@randydalrymple
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants