iCepa / Tor.framework

Tor framework for the iCepa project
Other
249 stars 55 forks source link

`failed to emit precompiled header` #93

Closed Fonta1n3 closed 3 months ago

Fonta1n3 commented 3 months ago

When running the framework on a simulator (device and my Mac works fine) I get the following errors (was working, now it is broken in all my projects using Tor.framework). I have googled it and tried almost everything from the multitude of answers but nothing seems to work. Any ideas?

Screenshot 2024-08-23 at 10 16 41
tladesignz commented 3 months ago

Weird. Is this with the latest version? Can you reproduce with the Example project provided here?

This might also hint at a misconfiguration of your Swift/Objective-C bridging headers. Check your project build configuration, you might have unwanted overrides for the simulator!

Fonta1n3 commented 3 months ago

When running the Example project following the readme instructions I get the following: (I tried deintegrating, clearing pod cache but same error)

Screenshot 2024-08-23 at 11 05 34
tladesignz commented 3 months ago

The Tor dependencies are sucked in via git submodules. This looks very much like you forgot git submodule update --init --recursive.

Fonta1n3 commented 3 months ago

I am able to run the Example project fine on simulator... Really not sure what I am doing wrong, Example is not in swift so our settings are not identical, as far as I know I have never altered any simulator specific build settings and I am sure it was working previously.

Screenshot 2024-08-26 at 10 38 00
tladesignz commented 3 months ago

Hm, weird. Still, I have to assume this is a problem on your side. I just released Onion Browser with Tor.framework 408.12.1. Never had a single issue.

Did you try to remove all dependencies, clear the pod cache and re-install them? The error message from the picture insinuates, that the important header file TORController.h from Tor.framework isn't there, although it should. Is that file where it should be?

On the other hand, do you even need that referenced in your bridging header? Xcode should make Objective-C code automatically available to Swift, when it is in its own module. Maybe you might just need to remove all references to Tor.framework from your bridging header?

Fonta1n3 commented 3 months ago

I have one existing project that is not affected and new test projects are not affected so I can compare.

Its easier to post images to show the difference: The broken project:

broken

The working project:

working

Any idea how to force cocoa pods to install the same xcfilelist in [CP] Embed Pods Frameworks with my broken project? I have tried deintegrating the pod, cleaning the pod cache and reinstalling numerous times while also deleting derived data etc with no luck.

Fonta1n3 commented 3 months ago

Fixed it, needed to set Target -> Build Settings Build Active Architecture Only Debug to Yes and Release to No, it was Debug No causing the issue it seems. Also removed the unnecessary bridging header.

EDIT: That actually wasn't it either, it was to do with the bridging header as you said, deleting it and removing related build settings fixed the issue.