Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native ios 0.69.1 React-Codegen Build failed. #34126

Closed
theartificialguy opened this issue Jul 4, 2022 · 12 comments
Closed

React native ios 0.69.1 React-Codegen Build failed. #34126

theartificialguy opened this issue Jul 4, 2022 · 12 comments
Labels
Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@theartificialguy
Copy link

theartificialguy commented Jul 4, 2022

Description

I recently created a new project using npx react-native init myapp --template react-native-template-typescript, everything is working in android, but when I try to build for iOS, the build fails due to React-Codegen errors specifically in FBReactNativeSpec.h file. Below is the build error output from xcode:

xcode-build-error

Whole log:

In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2206:46: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"window"] = window.has_value() ? window.value().buildUnsafeRawValue() : nil;
                                             ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2208:46: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"screen"] = screen.has_value() ? screen.value().buildUnsafeRawValue() : nil;
                                             ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2210:88: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"windowPhysicalPixels"] = windowPhysicalPixels.has_value() ? windowPhysicalPixels.value().buildUnsafeRawValue() : nil;
                                                                                       ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2212:88: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"screenPhysicalPixels"] = screenPhysicalPixels.has_value() ? screenPhysicalPixels.value().buildUnsafeRawValue() : nil;
                                                                                       ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2223:96: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"isIPhoneX_deprecated"] = isIPhoneX_deprecated.has_value() ? @((BOOL)isIPhoneX_deprecated.value()) : nil;
                                                                                               ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2462:68: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"prerelease"] = prerelease.has_value() ? @((double)prerelease.value()) : nil;
                                                                   ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2588:110: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"DEFAULT_BACKGROUND_COLOR"] = DEFAULT_BACKGROUND_COLOR.has_value() ? @((double)DEFAULT_BACKGROUND_COLOR.value()) : nil;
                                                                                                             ^
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/macbookair/Desktop/justChat/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/optional:953:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
7 errors generated.


** BUILD FAILED **


The following build commands failed:
    CompileC /Users/macbookair/Library/Developer/Xcode/DerivedData/justChat-gvlyyuoxvfahekfvnoiuaatjtplq/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/x86_64/FBReactNativeSpec-generated.o /Users/macbookair/Desktop/justChat/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Version

0.69.1

Output of npx react-native info

System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 69.61 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 16.15.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
Android NDK: 24.0.8215888
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.1 => 0.69.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. Create a new project using command: npx react-native init justChat --template react-native-template-typescript
  2. yarn ios to build the app.

It may be possible that this error occurs in react-native 0.69.1, I tried to create 2 new projects, got same build errors in both. It's been 3 days since I'm dealing with this issue.

So, can anyone help me out here? Thanks!

Snack, code example, screenshot, or link to a repository

xcode-build-error

@cortinico
Copy link
Contributor

It may be possible that this error occurs in react-native 0.69.1, I tried to create 2 new projects, got same build errors in both. It's been 3 days since I'm dealing with this issue.

Could you try without the --template react-native-template-typescript flag and mention if this is having the same build failure or not?

@theartificialguy
Copy link
Author

It may be possible that this error occurs in react-native 0.69.1, I tried to create 2 new projects, got same build errors in both. It's been 3 days since I'm dealing with this issue.

Could you try without the --template react-native-template-typescript flag and mention if this is having the same build failure or not?

Hi, I just tried what you suggested, got the exact same result as mentioned above!

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 5, 2022
@RobberJJ
Copy link

RobberJJ commented Jul 25, 2022

0.69.2 is ok, iOS Deployment Target change to 12.4. #34106

@cortinico
Copy link
Contributor

0.69.2 is ok

@theartificialguy Can you try again on 0.69.2 so we can close this issue?

@cortinico cortinico added Needs: Author Feedback and removed Needs: Attention Issues where the author has responded to feedback. labels Jul 29, 2022
@theartificialguy
Copy link
Author

Yes, it is working now. Thank you!

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Jul 31, 2022
@cortinico cortinico added Resolution: Fixed A PR that fixes this issue has been merged. and removed Needs: Attention Issues where the author has responded to feedback. labels Jul 31, 2022
@skurgansky-sugarcrm
Copy link

got this issue on RN 0.71.5 after updating XCode. what could be wrong ?

@skurgansky-sugarcrm
Copy link

#34106 (comment)
this helped me. set everywhere 12.0
in Pods -> targets -> React-Codegen -> Deployment -> iOS Deployment Terget
image
in project -> info
image
in target -> general
image

@itsmeshusha
Copy link

@skurgansky-sugarcrm thank you!! it helps for me (but i dont know why it helps...)

@jeveloper
Copy link

#34106 (comment)
this helped me. set everywhere 12.0
in Pods -> targets -> React-Codegen -> Deployment -> iOS Deployment Terget
image
in project -> info
image
in target -> general
image

Hey friend, thank you for this.
I wanted to check with you. Changing targets for all pod projects is suggested by Xcode. Is that what you did?
I am guessing all this is unnecessary had I been on RN 71 for this particular project.

@skurgansky-sugarcrm
Copy link

it is this issue #34106 (comment)
Fixed by changing targets in Podfile automatically in new releases of RN

@sanathe06
Copy link

I tried this but it gives me the following error
ld: framework not found hermes clang: error: linker command failed with exit code 1 (use -v to see invocation)

@francoders
Copy link

francoders commented Apr 25, 2023

#34106 (comentario) esto me ayudó. configurar en todas partes 12.0 en Pods -> objetivos -> React-Codegen -> Implementación -> Implementación de iOS Terget en proyecto -> información en destino -> general imagen imagen imagen

Thanks, this worked for me 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests

9 participants