react-native: Build fails on Xcode 14.3 RC
Description
Xcode Cloud now offers and appears to auto-select Xcode 14.3 Release Candidate for builds. This trips an iOS versioning bug. This is the relevant error section:
=== BUILD TARGET React-Codegen OF PROJECT Pods WITH CONFIGURATION Release === 2s Passed Make symlink libReact-Codegen.a 0s Passed Write all-product-headers.yaml 0s Passed Write React-Codegen.hmap 0s Passed Write React-Codegen-project-headers.hmap 0s Passed Write React-Codegen-own-target-headers.hmap 0s Passed Write React-Codegen-generated-files.hmap 0s Passed Write React-Codegen-all-target-headers.hmap 0s Passed Write React-Codegen-all-non-framework-target-headers.hmap 0s Passed Write React-Codegen.LinkFileList (arm64) 0s Passed Compile React-Codegen-dummy.m (arm64) 0s Error Compile FBReactNativeSpec-generated.mm (arm64) 2s Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0 Error ‘value’ is unavailable: introduced in iOS 12.0
So, the error is that react-native’s minimum version is iOS 12.4 but many pods are getting set to 11.0. The surface answer is to patch the projects, but the underlying problem is get_react_codegen_spec
uses a hardcoded ‘11.0’ rather than ‘12.4’ or min_ios_version_supported
defined in react_native_pods.rb.
React Native Version
0.71.4
Output of npx react-native info
NOTE: This is from my local machine. I am working on getting npx react-native info
output from the build machine on Xcode Cloud.
info Fetching system and libraries information… System: OS: macOS 13.2.1 CPU: (10) arm64 Apple M1 Max Memory: 707.53 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.5.0 - /opt/homebrew/bin/node Yarn: Not Found npm: 9.3.1 - /opt/homebrew/bin/npm Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9477386 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 19.0.2 - /opt/homebrew/opt/openjdk/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: ^0.71.4 => 0.71.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Create a sample project and connect to Xcode Cloud in App Store Connect. Run workflow on Xcode 14.3 RC.
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 36
- Comments: 47 (4 by maintainers)
Links to this issue
Commits related to this issue
- Add XCode workaround https://github.com/facebook/react-native/issues/36635 — committed to FaceTheFacts/face-the-facts-app by RichardKruemmel a year ago
I posted a workaround to the sample project:
https://github.com/travis-mark/lrn/commit/015854716feadd61a904d5a603b027426472f863
The underlying issue should probably be addressed in react-native directly, but I’m less familiar with patching those files directly.
There is an easy fix with CocoaPod. Inside your Podfile change the iOS Deployment Target for the specific package
Im having the same issue but Im not in a Mac. Im using Expo, so whenever I run Expo Start and run the react native app I get:
` None of these files exist:
Any clue?
after upgrading xcode to latest version 14.3 and sdk 16.4 this problem start appearing i fix it by changing IOS development for pods (react-codegen) from 11.0 to latest 12.4 run the app using command and it get fixed.
I am using expo but do not see iOS folder I currently build with eas, pleas help.
Ok, this is how I “solved” it for now:
The easier and fastest way to avoid this until the fix is not there is to downgrade the version of your XCode back to
14.2
.Ya’ll can do this downloading it from here and moving to the applications folder. You might need to run the project from XCode before going back to cli
Just change min_ios_version_supported in Xcode for 12.4
There’s a minimum fix that should land next week for 0.69.9, 0.70.8, 0.71.6 and 0.72-RC1.
@travis-mark Do we anything need to change in xcode to use the workaround
Because, I get this after pod install in ios directory
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
[!] Invalid
Podfile
file: undefined local variable or method `min_ios_version_supported’ for #Pod::Podfile:0x00007fd75bcfdc00.We were using react-native@69.* and only updating to 69.9 did not fix the issue. The only fix that helped was adding -no-verify-emitted-module-interface flag in Podfile:
I couldn’t get the workaround working because react-native-skia has issues when building the project
Just a quick note, if you’re new. Make sure to reinstall pods.
After applying the workaround from tavis-mark I had a very strange issue where the pods frameworks script would fail to copy the framework files when archiving a build (building worked fine). Turns out readlink would produce an invalid path and that’s why it failed.
I had to modify ios/Pods/Target Support Files/Pods-projectname/Pods-projectname-frameworks.sh and change
to
after that archiving worked again.
@Santosl2 I ended up just updating to Expo v48. I guess there’s a fix in one of the versions in between but not sure which. If you’re unable to move to 48, perhaps you could try the last version of Expo 47.
This is working for me.
@travis-mark can you confirm, please?
You are an absolute legend! Thank you