I'm trying to update the Facebook SDK for an iOS project.
Initially I had version 11.2.1. With this everything works like charm.
After updating to 12.3.1 (the latest), it works well building for debug. However, when trying to build for Release, it fails with the following error.
<unknown>:0: error: module map file '/Users/XXX/Library/Developer/Xcode/DerivedData/App/Build/Products/Release-iphoneos/FBSDKCoreKit/FBSDKCoreKit.modulemap' not found
<unknown>:0: error: module map file '/Users/XXX/Library/Developer/Xcode/DerivedData/App/Build/Products/Release-iphoneos/FBSDKLoginKit/FBSDKLoginKit.modulemap' not found
<unknown>:0: error: module map file '/Users/XXX/Library/Developer/Xcode/DerivedData/App/Build/Products/Release-iphoneos/FBSDKShareKit/FBSDKShareKit.modulemap' not found
It also fails for version 12.0.0 (which is the next release after 11.2.1).
I have tried to install the SDK both via CocoaPods and via SPM (as detailed here). It fails in both cases.
Development enviroment/settings:
- MacOS Big Sur 11.5.2
- Testing on an iPhone 11 with iOS 14.8.1
- Tried with both Xcode 12.5.1 and 13.2.1
- Project uses Swift 5
- Deployment target of the Project is set to iOS 13.0
There are several reports of this error here in Stack Overflow, in the SDK repo and also in the SDK old repo. After checking them, I have tested all the following, without success:
- I'm opening the .xcworkspace, not the .xcproject (as stated here)
- I have the same iOS version set in both the Project, the Targets and the Pods (as stated here)
- I have performed several full clean-ups (pod clean + deintegrate, Product > Clean Build Folder in Xcode as well as deleting the Derived Data folder).
- I've tried setting Validate Workspace to Yes (as explained here)
- I've tried messing around with the Excluded Architectures settings as explained in many threads, but did not work (which didn't surprise me because those are targeted to running in simulators, and I'm doing so with a real device).
- I've set "Build Active Architecture Only" to Yes even for release mode (as explained here)
- I've played with the following stuff in the Podfile postinstall (suggested here)
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Initially I only had this, which ensures that Pods have iOS 13.0 as target
if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 13.0
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
# Then I also tried this
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
# Also tried setting this
config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
# As well as this
config.build_settings[“EXCLUDED_ARCHS[sdk=iphonesimulator*]“] = “arm64”
end
end
end