After switching to Xcode 10 (Have to use legacy build system for now), I started getting errors shown below. Locally I was able to fix them by pretty much cleaning everything I can i.e. Derived Data / Build etc...
Debug and Release runs in Xcode run fine for me, however I've been struggling to solve this issue in our CI (bitrise).
We use Fastlane and our lane has steps to clear derived data and perform clean build.
clear_derived_data
build_ios_app(
workspace: "application.xcworkspace",
scheme: "application",
clean: true
)
Yet these errors keep happening (these are few examples, there are around 30 errors like this following one another and pointing to same packages like Darwin etc..):
❌ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:10: could not build module 'Darwin'
#include <sys/types.h>
^~~~~~~~
❌ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/usr/include/dispatch/dispatch.h:25:10: could not build module 'Darwin'
#include <Availability.h>
~~~~~~~~^
❌ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: could not build module 'CoreFoundation'
#include <CoreFoundation/CoreFoundation.h>
~~~~~~~~^
❌ /Users/vagrant/git/packages/skimitar-app/node_modules/react-native-firebase/ios/RNFirebase/functions/RNFirebaseFunctions.h:3:9: could not build module 'Foundation'
#import <Foundation/Foundation.h>
~~~~~~~~^
EDIT: Does legazy build setting persist i.e. if set in our Xcode and committed to git, will ci also use legacy build system?
I resolve this issue by setting the build system to Legacy.
Open the PROJECT_NAME.workspace file
Then in the top menu select File > Workspace Settings
Then change Build System
to Legacy Build System
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With