facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.32k stars 24.36k forks source link

Build fails for Xcode 15 for 17 version #42010

Closed g7crservice-Binni-kumari closed 10 months ago

g7crservice-Binni-kumari commented 11 months ago

Description

In Hash file I got in these set of line of code

**#else template struct hash_base : std::unary_function<T, std::size_t> {};

endif**

I modified underscore as suggested

**#else template struct hash_base : std::__unary_function<T, std::size_t> {};

endif**

After this, I am getting errors in FBReactnativeSpec file

Screenshot 2023-12-20 at 12 50 28 PM

As you can see in this image.

why this error is coming? Is it new error or I am missing something?

Steps to reproduce

  1. Install New version Somona.
  2. Install xcode latest version - 15.1
  3. Install latest emulator - < 17 verion , I am running iPhone 15 pro max.
  4. try to build from xocde.

React Native Version

0.70.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

I can not print the output, as mentioned in the above image getting a build error.

Stacktrace or Logs

Value is unavailable introduced in ios 12.0.

Reproducer

https://github.com/below/react-Xcode15Bug

Screenshots and Videos

Screenshot 2023-12-20 at 12 50 28 PM
github-actions[bot] commented 11 months ago
:warning: Unsupported Version of React Native
:information_source: It looks like your issue or the example you provided uses an unsupported version of React Native.

Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.
github-actions[bot] commented 11 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
g7crservice-Binni-kumari commented 11 months ago

Okay, I have created this repository Under - Reproducer template PF -

https://github.com/g7crservice-Binni-kumari/Ios-Build-error--for-17-verison

pnthach95 commented 11 months ago

You report about v0.70.0, but 2 reproducers are 0.71.8 (copied from https://github.com/facebook/react-native/issues/37748) and 0.73.1 (which is never failed with xcode 15). If you want to run v0.70 with xcode 15, use v0.70.14 or latest version

g7crservice-Binni-kumari commented 11 months ago

Thank you @pnthach95 , For your response, As you said I have updated my React Native Version to latest- 0.72.8, still I am facing same issue.

pnthach95 commented 11 months ago

How do you upgrade? If you only bump version in package.json, it fails 100%. And 0.72.8 isn't the latest

g7crservice-Binni-kumari commented 11 months ago

I just hit the command yarn add @type/react-native - 0.72.8 Yarn add react-native - 0.73.1

When I am updating the react-native package - From node module react-native-gradle-plugin file is getting removed.

after getting I am not able to build even in android.

PF attached image of errors in android and ios.

![Uploading Screenshot 2023-12-20 at 3.39.54 PM.png…]()

pnthach95 commented 11 months ago

That isn't how to upgrade react native version, use upgrade helper. Your screenshot didn't finish uploading

supriyoMondal commented 11 months ago

to fix the problem you are facing you need to open project in xcode , inside the targets select react-codegen , go to build settings , make sure iOS deployment target is minimum 12.4.

cortinico commented 10 months ago

Closing as you received relevant answers already. React Native 0.70 was not compatible with XCode 15. If you upgrade to the latest stable (0.73) you should be able to build correctly