facebook / react-native

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

XCode 15.3 — flipper crushes the build #43693

Open kuzkokov opened 1 month ago

kuzkokov commented 1 month ago

Description

When using the latest XCode version the build crashes trying to build FlipperKit. XCode 15.2 works fine. Unfortunately, can't attach the reproducer since github actions don't have XCode 15.3 support yet.

Steps to reproduce

  1. Initialise the app from the template with RN 0.71.17
  2. Run the iOS build on XCode 15.3

React Native Version

0.71.17

Affected Platforms

Other (please specify)

Output of npx react-native info

-

Stacktrace or Logs

In file included from /Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:10:
In file included from /Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.h:10:
/Users/builder/clone/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:24:14: error: no template named 'function' in namespace 'std'
typedef std::function<void(SocketEvent)> SocketEventHandler;
        ~~~~~^
/Users/builder/clone/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:29:14: error: no template named 'function' in namespace 'std'
typedef std::function<void(const std::string& message)> SocketMessageHandler;
        ~~~~~^
/Users/builder/clone/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:38:14: error: no template named 'function' in namespace 'std'
typedef std::function<std::string(char* password, size_t length)>
        ~~~~~^
/Users/builder/clone/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:45:14: error: no template named 'function' in namespace 'std'
typedef std::function<void()> SocketSendHandler;
        ~~~~~^
/Users/builder/clone/ios/Pods/Headers/Private/Flipper/FlipperTransportTypes.h:54:14: error: no template named 'function' in namespace 'std'
typedef std::function<void(std::string response, bool isError)>
        ~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:57:46: error: called object type 'facebook::flipper::SocketCertificateProvider' (aka 'int') is not a function or function pointer
  auto certificatePath = _certificateProvider(&PASSWORD[0], 512);
                         ~~~~~~~~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:158:18: error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
    _eventHandler(facebook::flipper::SocketEvent::CLOSE);
    ~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:185:16: error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
  _eventHandler(facebook::flipper::SocketEvent::OPEN);
  ~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:206:18: error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
    _eventHandler(facebook::flipper::SocketEvent::SSL_ERROR);
    ~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:208:18: error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
    _eventHandler(facebook::flipper::SocketEvent::ERROR);
    ~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:217:16: error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer
  _eventHandler(facebook::flipper::SocketEvent::CLOSE);
  ~~~~~~~~~~~~~^
/Users/builder/clone/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm:224:20: error: called object type 'facebook::flipper::SocketMessageHandler' (aka 'int') is not a function or function pointer
    _messageHandler([response UTF8String]);
    ~~~~~~~~~~~~~~~^
12 errors generated.

Reproducer

N/A

Screenshots and Videos

No response

github-actions[bot] commented 1 month 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.
cortinico commented 1 month ago

When using the latest XCode version the build crashes trying to build FlipperKit.

Is there anything preventing you from removing Flipper?

kuzkokov commented 1 month ago

@cortinico wdym? it comes with the RN out of the box, isn't it?

cortinico commented 1 month ago

@cortinico wdym? it comes with the RN out of the box, isn't it?

We're removing it in 0.74. You can disable it from your build if you're not using it and it's making your build harder to maintain. There is an option in the Podfile to do so

kuzkokov commented 1 month ago

We're removing it in 0.74. You can disable it from your build if you're not using it and it's making your build harder to maintain. There is an option in the Podfile to do so

well, okay. it's actually not a problem for me to use XCode 15.2 f.e. as well, but what you are saying is that RN < 0.74 isn't going to support latest XCode out of the box. is it okay for the RN team?

zhongwuzw commented 1 month ago

You can just apply the fix to flipperkit, please see https://github.com/facebook/flipper/commit/b3dcdb87f930dbbc9dbacb53ad60996e0111e7d8

Ahsanali012 commented 1 month ago

still getting this error while building the app . For React native version 0.72.3

folly/folly-config.h not found

Bibazavr commented 2 weeks ago

fixed

Ahsanali012 commented 2 weeks ago

@Bibazavr How to fix can you explain

Bibazavr commented 2 weeks ago

@Ahsanali012 , just update RN to 0.71.18 or 0.72.12

Or you can look into changelog of react native and find out by yourself - which version include fixes for new xcode:)

Ahsanali012 commented 1 week ago

@Bibazavr i updated my project to 0.71.18 or 0.72.12 still the issue is same. folly/folly-config.h not found