After Upgrading React Native to 68.6 and switching back to any branch. Often get CompileC clang errors. I often see this error when either installing new packages, with my package lock or upgrading from version to version with react native.
Some pods are using the wrong target version, but this is not the case when building.
Steps I've tried:
watchman watch-del-all && killall -9 node && rm -rf yarn.lock package-lock.json node_modules ios/Pods ios/Podfile.lock android/app/build && npm install && cd ios && pod update && cd .. && npm start -- --reset-cache"
xcrun simctl shutdown all xcrun simctl erase all
or
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
2023-04-04 09:19:19.164 xcodebuild[87551:1680692] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:BE127B8C-C1DA-4AE9-B3DB-101C76E645FE, OS:16.4, name:iPhone 13 }
{ platform:iOS Simulator, id:BE127B8C-C1DA-4AE9-B3DB-101C76E645FE, OS:16.4, name:iPhone 13 }
** BUILD FAILED **
The following build commands failed:
CompileC /Users/me/repositories/MyMobileApp/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Yoga.build/Objects-normal/arm64/Yoga.o /Users/me/repositories/MyMobileApp/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'Yoga' from project 'Pods')
(1 failure)
This is not unique to this Yoga.cpp, this continues to happen seemingly regardless of package. I'm on Xcode 14.3. Android builds just fine and I can usually troubleshoot any android related issues very easily. It does seem to be simulator / pods / xcode related, but I have yet, after all this troubelshooting been able to find an exact culprit. In the past, I've closed things down and sometimes it just works after running a number of steps. I cant remember which step it was that solved the issue. Master of this branch builds in the pipelines, I've had this branch build before, but switching from a different upgraded branch with different packages or versions of react or packages that involve any native ios changes or pod updates and switching back seems to completely mess up my simulator.
This seems to be the related yoga post, but only when moving from a newer react native project and going back to master -> the above error appears Use of bitwise '|' with boolean operands
This seemed to fix it after all the troubleshooting. Just changing and saving it. No need for patch-package. At least locally. Seems Xcode 14.3 related. Use of bitwise '|' with boolean operands