FAT Binary with xcode 10.2?

I am trying to create a FAT binary with multiple architecture slices and publish a swift module. Which works perfectly fine.

On the other side, when I am consuming this framework, I get compilation issues about methods not found. Something to do with <framework>-Swift.h not working correctly.

Apple published this - https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes/


Which states -

Known Issues


If you’re building a framework containing Swift code and using

lipo
to create a binary that supports both device and simulator platforms, you must also combine the generated
Framework-Swift.h
headers for each platform to create a header that supports both device and simulator platforms. (48635615) For example, if you’ve built:-
iOS/Framework.framework
-
iOS Simulator/Framework.framework
Take:-
iOS/Framework.framework/Headers/Framework-Swift.h
-
iOS Simulator/Framework.framework/Framework-Swift.h
Create a new:-
iOS + iOS Simulator/Framework.framework/Headers/Framework-Swift.h
The contents of the new
Framework-Swift.h
should be:
#if TARGET_OS_SIMULATOR <contents of original iOS Simulator/Framework.framework/Framework-Swift.h> 
#else <contents of original iOS/Framework.framework/Framework-Swift.h>
#endif
The workaround suggested by apple is also in place but I am not able to consume a swift framework. Has anyone faced a similar issue?
Thanks!



Replies

Yes I'm experiencing this issue also, I can't get this to work either, what does your build script look like?

I tried the above script also but it didn't worked. Can anyone suggest me how to fix this.

Hi,

that script worked for me, but I had to do a little tweak to the script itself (see my reply to the post in that github page)