'React Native Build Failed CompileC error / Xcode 11.6 Workspace integrity error
I am having an issue with building a react native project using the npx react-native run-ios command and am also unable to load the .xcworkspace file found in the project's ios folder with Xcode 11.6. I ran into issues ejecting from expo with my project and decided to build a bare workflow with react native from scratch. I start metro using
npx react-native start
but when I run
npx react-native run-ios
I get a build error. When I then try to build the project with Xcode, Xcode is unable to load the workspace file.
**What I've Tried: **
Xcode 11.6 load error:
When trying to load the .xcworkspace file for my project with Xcode 11.6, I receive 2 errors:
I have tried looking at other similar questions regarding this issue such as this question:
XCode workspace integrity - couldn't load project (pods.xcodepoj) but was unable to resolve the error for Xcode. I thought this would resolve any issues related to the Podfile since this is the source of most issues related to the CompileC build error. I have also tried deleting the DerivedData folder for XCode from Preferences > Locations and clicked on the gray arrow to delete all the content found within DerivedData. I expected this to clear the cache, but the problem continued after trying to load the workspace file with Xcode.
npx react-native run-ios build error:
When running npx react-native run-ios to build my project I receive the following error in the terminal:
** BUILD FAILED **
The following build commands failed: CompileC /Users/macbookpro/Library/Developer/Xcode/DerivedData/RPi4BLETest-aymtjirbusdwgxdwltojdnzrjclc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTDatePickerManager.o /Users/macbookpro/Desktop/JSProjects/RPi4BLETest/node_modules/react-native/React/Views/RCTDatePickerManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler failure)
For the npx react-native run-ios command, I tried the following: (https://github.com/facebook/react-native/issues/26118)
rm -rf ~/Library/Caches/CocoaPods rm -rf Pods rm -rf ~/Library/Developer/Xcode/DerivedData/* pod deintegrate pod setup
I also tried to comment out the folly lines found in the Podfile file in the ios folder, deleted the Podfile.lock file and ran
pod install
I also edited the folly lines of code in Podfile to use
use_flipper!({ 'Flipper-Folly' => '2.3.0' }) i
instead of
use_flipper!,
deleted Podfile.lock and ran pod install in the ios folder and still no resolution to the error. I have also tried using other commands such as yarn ios and npm run ios, but all of these give me the same error as the npx command.
I would like to know what the solution to resolving this error might be or any insight as to what could be causing it.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
