software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.05k stars 1.31k forks source link

[3.16.1] [0.76.1] Implicit instantiation of undefined template 'std::basic_stringstream<char>' #6673

Open dawid-bytys opened 1 week ago

dawid-bytys commented 1 week ago

Description

Hello,

I found a bug when building for iOS in Release mode (in Debug it works fine) on RN version 0.76.1 and reanimated version 3.16.1. The bug is related to the new architecture (and possibly XCode version 15.2?).

Steps to reproduce

  1. npx @react-native-community/cli@latest init App
  2. yarn add react-native-reanimated
  3. cd ios && pod install
  4. add plugin to the babel.config.js
  5. try to build the app in XCode in Release mode (edit existing scheme and set Run to Release)
Screenshot 2024-11-07 at 1 24 20 AM

Snack or a link to a repository

https://github.com/dawid-bytys/reanimated-bug-reproduction

Reanimated version

3.16.1

React Native version

0.76.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Other (please specify)

Device

iOS simulator

Device model

iPhone 15 Pro (iOS 17.2)

Acknowledgements

Yes

Mubashirkhan commented 1 week ago

Having the same issue

adrianperomingo commented 1 week ago

Same versions as @dawid-bytys even Xcode 15.2 (15C500b). Just in Release mode

This is the file which throws the error: .../node_modules/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.cpp

Captura de pantalla 2024-11-07 a las 17 31 34

Redirects to line 303 when clicks on the error

Captura de pantalla 2024-11-07 a las 17 32 11

Please help 😞

vincicat commented 6 days ago

fixed by adding new import on top (or any place in the header section that you are sure it will load) of this file node_modules/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.cpp:

#include <sstream>

I am curious why it was fine in version in 0.75 but broken in 0.76.1....(both XCode 15.1)

adrianperomingo commented 6 days ago

Can someone add it to a commit and make a release for the hotfix? It's a very simple fix...

dawid-bytys commented 6 days ago

Can someone add it to a commit and make a release for the hotfix? It's a very simple fix...

You can use patch-package for now.

adrianperomingo commented 6 days ago

can patch-package works in an CI/CD using AppCenter? @dawid-bytys

vincicat commented 6 days ago

Can someone add it to a commit and make a release for the hotfix? It's a very simple fix...

Short Answer: I am not an expert of C++ and this library. Not sure will that cause duplicate header import in other React Native/XCode combination then break their building process...better use patch-package or yarn patch for now

dawid-bytys commented 6 days ago

can patch-package works in an CI/CD using AppCenter? @dawid-bytys

Yes, just add "postinstall": "patch-package" script to package.json.

adrianperomingo commented 6 days ago

Yes, i have already did it and works in local. I wanted to know about in AppCenter. It's fine guys, thanks for the help ❤️