Custom Framework cannot build any system module

Hello,


I am facing the following issue:


I have a custom framework (iOS) which has dependancy of another 3 frameworks. The framework is written in Objective C. While developing with no problems at all, I recently recieved build errors:



Declaration of 'jmp_buf' must be imported from module 'Darwin.C.setjmp' before it is required
Could not build module CoreFoundation
Could not build module Foundation
Could not build module UIKit
Could not build module CoreGraphics

I haven't change any system files or files from some system framework. Interesting is that If I install the framework on separate mac with the same xcode I get build success. After a while I get these errors again. 😐


Screenshot-2020-05-12-at-10-29-42 — ImgBB

I am also attaching a screenshot.


I already tried cleaning derived data, clean build, clean build folder.. I even re-install Xcode and still the same


Sometimes on real device is bulding with success on simulator not, but most of the time on both places is with this error.


Xcode version: 11.4.1

macOS Catalina version: 10.15.4

Real device tested: iPhone XS 13.4.1

Simulator tested: iPhone 11 13.4.1 and iPhone X 12.4

Even Im also facing same issue.Im using Xcode 12.4, this occurred when I try to upgrade swift 4.2 to 5.

This has been happening since Xcode 10.

I have an app that uses PJSIP. When I archive, I get the same error. I have to then remove all references of the library out of the app, delete all the headers from the filesystem. Then I have to archive again and let the process fail. After this I can revert the changes and then it works fine.

When I want to debug app again, I need to follow the same process and then I can debug until I need to archive again.

So this, in my opinion points to some sort of internal Xcode caching issue when linking an external library.

I have tried all the different cleanup methods available on the internet. I have even created a new sample app with only the PJSIP library, I have even reset the mac to factory default, cleared derived data etc.. Nothing works, except the workaround that I found.

At least I have a workaround, its just a pain.

Custom Framework cannot build any system module
 
 
Q