react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

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

Open dawid-bytys opened this issue 2 years ago • 11 comments

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

dawid-bytys avatar Nov 07 '24 00:11 dawid-bytys

Having the same issue

Mubashirkhan avatar Nov 07 '24 12:11 Mubashirkhan

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 😞

adrianperomingo avatar Nov 07 '24 16:11 adrianperomingo

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)

vincicat avatar Nov 07 '24 17:11 vincicat

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

adrianperomingo avatar Nov 07 '24 17:11 adrianperomingo

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.

dawid-bytys avatar Nov 07 '24 18:11 dawid-bytys

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

adrianperomingo avatar Nov 07 '24 18:11 adrianperomingo

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

vincicat avatar Nov 07 '24 18:11 vincicat

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

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

dawid-bytys avatar Nov 07 '24 18:11 dawid-bytys

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 ❤️

adrianperomingo avatar Nov 07 '24 18:11 adrianperomingo

@tjzel, any updates on this?

gabrieldonadel avatar Nov 20 '24 22:11 gabrieldonadel

@gabrieldonadel Thanks for pinging me, I didn't know there was an issue open about this. The fix for this has been released in [email protected]:

  • https://github.com/software-mansion/react-native-reanimated/pull/6725

tjzel avatar Nov 21 '24 08:11 tjzel