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

[FIXED in 0.71.6, 0.70.8, 0.69.9] Xcode 14.3 (14E222b) Build Failed with React Native 0.71.5 #36739

Closed
bahadiraraz opened this issue Mar 31, 2023 · 59 comments · Fixed by appcues/appcues-react-native-module#79
Labels
Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: PR Submitted A pull request with a fix has been provided. Tool: Xcode

Comments

@bahadiraraz
Copy link

bahadiraraz commented Mar 31, 2023

EDIT: fixed in 71, 70 and 69 latest patches. Please read this comment for more details.


Description

The following build commands failed:
        CompileC /Users/bahadiraraz/Library/Developer/Xcode/DerivedData/mozzarellaui-gbkyyusquvgpyncsiuxkvfpzwcsu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/arm64/FBReactNativeSpec-generated.o /Users/bahadiraraz/WebstormProjects/mozzarella/mozzarellaui/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Codegen' from project 'Pods')
(1 failure)

I encountered the same error in Xcode Version 14.3 (14E222b) released yesterday.

  • "react-native": "0.71.5"

When I tried @travis-mark's solution issue #36635, it didn't work either. I also tried using 'M1' and other options instead of 'RC', but it still didn't work.

React Native Version

0.71.5

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1
    Memory: 74.83 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.13.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 9.6.1 - /usr/local/bin/npm
    Watchman: 2023.03.27.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: 19.0.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.5 => 0.71.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

npx react-native init Project
npx react-native run-ios

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

image

@GennadiyVSG
Copy link

I have the same issue

@cortinico
Copy link
Contributor

cc @cipolleschi

@travis-mark
Copy link

travis-mark commented Mar 31, 2023

@bahadiraraz can you post your current project or Podfile? It's possible since ruby inside Xcode offers little assistance that you're missing a piece of the patch.

@bahadiraraz
Copy link
Author

@bahadiraraz can you post your current project or Podfile? It's possible since ruby inside Xcode offers little assistance that you're missing a piece of the patch.

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'mozzarel' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    # Upcoming versions of React Native may rely on get_default_flags(), but
    # we make it explicit here to aid in the React Native upgrade process.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'mozzarelTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

@travis-mark
Copy link

@bahadiraraz The patch is not present. Am I missing something?

@bahadiraraz
Copy link
Author

bahadiraraz commented Mar 31, 2023

@travis-mark no, this patch has not been added,because I get the same error if it is added.

@monochrome-yeh
Copy link

same issue with expo & eas build

@Tapmeet
Copy link

Tapmeet commented Mar 31, 2023

ANy progress on this?

@coofzilla
Copy link

The patch that Travis posted worked for me. I copied and pasted the changes directly into my Podfile, then ran pod install from the ios directory.

Can anyone explain why this issue is happening? 🤔

@rajesh-vishwa
Copy link

rajesh-vishwa commented Apr 1, 2023

I also got issue when upgrade xcode this morning

The following build commands failed:
CompileC /Users/apple/Library/Developer/Xcode/DerivedData/mobileApp-fczllhwjaxnfricexizepfgaveji/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/x86_64/FBReactNativeSpec-generated.o /Users/apple/Documents/book-my-ground/mobileApp/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Codegen' from project 'Pods')
(1 failure)
]

@nilavassg
Copy link

+1 facing the same issue.

@omargera96
Copy link

Facing the same issue

@astrahov
Copy link

astrahov commented Apr 1, 2023

#36635

@cipolleschi
Copy link
Contributor

Minimum fix coming soon, hopefully next week, but can't promise anything: #36759

@blakef
Copy link
Contributor

blakef commented Apr 1, 2023

Just to add to @cipolleschi, fixes should be picked for these versions:

@LukeIKG
Copy link

LukeIKG commented Apr 1, 2023

Same problem. anyone got it running? also after xcode update i cant run my app in xcode directly (error: /Users/User/Project/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2063:46 'value' is unavailable: introduced in iOS 12.0). My deployment target is above 12.0 and it worked before the update. any ideas?

@slvssb
Copy link

slvssb commented Apr 1, 2023

Same problem. anyone got it running? also after xcode update i cant run my app in xcode directly (error: /Users/User/Project/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2063:46 'value' is unavailable: introduced in iOS 12.0). My deployment target is above 12.0 and it worked before the update. any ideas?

+1 Facing same with eas build

@cipolleschi
Copy link
Contributor

Minimum fix coming soon, hopefully next week, but can't promise anything: #36759

A fix is coming, we hope to be able to release patched versions next week.

Meanwhile, you can use the "patch" suggested here

Or use Xcode 14.2 tool chain with Xcode 14.3

@kelset kelset unpinned this issue Apr 14, 2023
@rohitgupta1996
Copy link

Issue is there for version 0.69.3 also

@cipolleschi
Copy link
Contributor

@rohitgupta1996 the latest patch for 0.69 is 0.69.9. I suggest you to update to that patch version, which should solve the issue.

@igortice
Copy link

i changed for 0.69.9 but now i have new problem
image

@kathrynowy
Copy link

I was facing this issue "normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler" for 4 days
0.71.6 RN
and I changed XCode version in Bitrise for the build to be 14.2 and M1 chip - it started to work

@smiley717
Copy link

smiley717 commented Jun 4, 2023

image

When I am trying to build for ios, I get this error.

System:
    OS: macOS 13.3.1
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz
    Memory: 823.06 MB / 31.63 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
    Watchman: 2023.05.08.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: Not Found
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.10121639
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.19 - /usr/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

@cipolleschi
Copy link
Contributor

Hi @smiley717, thanks for the question. There is no error specified in the Screenshot you took. It just says that it fails and where but not why.

I think you can search for "error:" in the log to understand what is the actual issue.

As soon as you have it, you can post it again so I can try to help you here.

@smiley717
Copy link

                      ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2067:88: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"windowPhysicalPixels"] = windowPhysicalPixels.has_value() ? windowPhysicalPixels.value().buildUnsafeRawValue() : nil;
                                                                                       ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/c++/v1/optional:1014:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2069:88: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"screenPhysicalPixels"] = screenPhysicalPixels.has_value() ? screenPhysicalPixels.value().buildUnsafeRawValue() : nil;
                                                                                       ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/c++/v1/optional:1014:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2080: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/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/c++/v1/optional:1014:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2288:68: error: 'value' is unavailable: introduced in iOS 12.0
  d[@"prerelease"] = prerelease.has_value() ? @((double)prerelease.value()) : nil;
                                                                   ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/c++/v1/optional:1014:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
/Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:2414: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/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm:14:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h:19:
In file included from /Users/user/Desktop/Work/synkbooks_app_v1/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTConvertHelpers.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk/usr/include/c++/v1/optional:1014:27: note: 'value' has been explicitly marked unavailable here
    constexpr value_type& value() &
                          ^
7 errors generated.

Hi @cipolleschi Thank you for catching up my post and there are too long logs to copy, but try to find errors ( others are warning).

it was working on the previous Mac 12, and just stop working with Mac13.4. so I was thinking of ruby-version

@smiley717
Copy link

HI @cipolleschi I was able to fix this issue by adding below code snippet to Podfile as suggested from others.

__apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      if target.name == "React-Codegen"
        target.build_configurations.each do |config|
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
        end
      end
    end

and then go to /ios folder and run pod install again. :)

@cipolleschi
Copy link
Contributor

Oh, I see. Actually, we already fixed that bug (introduced by Xcode) in 0.71.8. Just update your project to the last version of your minor and it will work!

@smiley717
Copy link

@cipolleschi Sounds great! I will update my project to 0.71.8 (I am using 0.71.4 right now) :)

@toscalivia83
Copy link

I had the same error with react native 0.72.0
Works fine with 0.71.7

@cipolleschi
Copy link
Contributor

Hi @toscalivia83, sorry to hear that. But are you sure?
The fix is in 0.72-stable: https://github.com/facebook/react-native/blob/0.72-stable/packages/react-native/scripts/cocoapods/codegen_utils.rb#L116

could you perhaps clean caches and retry reinstalling the pods?

@toscalivia83
Copy link

I did that twice and ran rm -rf ~/Library/Developer/Xcode/DerivedData/* && rm -rf ~/Library/Caches/org.swift.swiftpm
but the error remains the same

However I'm struggling to create the bundle on Android, I posted a question here and this is the reason why I tried upgrading
If it all works on 0.72.0 at some point I'll let you know
And if you or anyone you know can help me fix this issue ^ that would be awesome, thanks!

@cipolleschi
Copy link
Contributor

Could you check if this is set up properly?

  1. Click on the Pods project on the left
  2. Click on the React-Codegen target (could also have the icon of a temple 🏛️, doesn't matter)
  3. Click on Build settings on top
  4. filter for ios deployment
  5. What value is reported?
Screenshot 2023-06-23 at 12 31 47

@toscalivia83
Copy link

toscalivia83 commented Jun 25, 2023

Hello, this is the ios deployment target I had specified: (ios 13.0)
Screenshot 2023-06-25 at 23 33 47

It works on Android with react native version 0.72.0 now and I can create the bundle properly.
However it still does not work on iOS emulator or on my real device (I have an iPhone 7 on version 15.7.6). Even if use the patch suggested above in order to use version 12.4 it does not fix the issue
Any other idea?

@toscalivia83
Copy link

It does not seem to complain about Codegen though
Screenshot 2023-06-26 at 00 01 49

@cipolleschi
Copy link
Contributor

ok, so the error is another one and completely unrelated. Can I ask you to open a separate issue to track that? At least we can keep the problem separated and people with the same build errors can look up for the right solution for their specific issue.

Thank you so much! 🙏

@toscalivia83
Copy link

Thanks for your reply @cipolleschi
I've created an issue here for this bug

@kenchoong
Copy link

you need to make sure your folder name is not having space
folder name:
code project ❌
code-project ✅

@jeffngugi
Copy link

I had to downgrade to 14.2 since I am running some other old project 0.66 and had so many issues. Upgrading to 14.3 once I update my RN projects

@MAgungHKM
Copy link

just need to make sure, is this fixed in 0.72.4?

@Vasault
Copy link

Vasault commented Nov 26, 2024

unbelievable this issue still persist, i'm at 0.74 right now, and it came up out of nowhere

@mishalbutt114
Copy link

facing the same issue from past three days and unable to resolve

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. Resolution: PR Submitted A pull request with a fix has been provided. Tool: Xcode
Projects
None yet
Development

Successfully merging a pull request may close this issue.