Saturday, 26 January 2019

Creating a fat framework with an objective c framework dependency

I am working with Swift 4.2 and Xcode 10.1. I am trying to build a framework in Swift that depends on Alamofire which is written in Objective C. I added the Alamofire.xcodeproj manually as given in the README by Alamofire. The individual target builds fine. My Framework target builds fine.

The problem arises when I try to create a fat framework using a script that uses the following command

xcodebuild -project "${FRAMEWORK_NAME}.xcodeproj" -scheme "${FRAMEWORK_NAME}" -configuration "${CONFIGURATION}" -arch arm64 -arch armv7 -arch armv7s only_active_arch=no BITCODE_GENERATION_MODE=bitcode defines_module=yes -sdk "iphoneos" -derivedDataPath "${OUTPUT_DIR}"

I get the following error:

umbrella header 'Alamofire.h' not found

could not build Objective-C module 'Alamofire'

The second line of the error is coming from another dependency 'Moya' that depends on Alamofire (See Image)
enter image description here

It's puzzling that normal Cmd+B works fine for usual target but xcodebuild fails.

Things that I attempted:

  1. Delete Derived folder, Clean Build.
  2. Build individual dependencies first and then build the Universal Aggregated Target.
  3. Creating a custom module map

I think xcodebuild command needs more input. What am I missing?



from Creating a fat framework with an objective c framework dependency

No comments:

Post a Comment