Repository navigation
Closed
Labels
Needs reviewIssue is ready to be reviewed by a maintainerIssue is ready to be reviewed by a maintainerPlatform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snippet of code, snack or repo is providedA reproduction with a snippet of code, snack or repo is provided
Description
Description
Version 2.17.0 of this library encounters C++ dialect-related build errors on React Native 0.72.0-rc.5:
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-cxxreact/cxxreact/NativeModule.h:28:26: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
using MethodCallResult = std::optional<folly::dynamic>;
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-cxxreact/cxxreact/ModuleRegistry.h:50:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<ModuleConfig> getConfig(const std::string &name);
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-jsiexecutor/jsireact/JSINativeModules.h:30:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<jsi::Function> m_genNativeModuleJS;
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-jsiexecutor/jsireact/JSINativeModules.h:34:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<jsi::Object> createModule(
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-jsiexecutor/jsireact/JSIExecutor.h:131:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<jsi::Function> callFunctionReturnFlushedQueue_;
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-jsiexecutor/jsireact/JSIExecutor.h:132:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<jsi::Function> invokeCallbackAndReturnFlushedQueue_;
^
❌ /Users/jeff/Projects/groove/deps/react-native-app/RNReanimated2/ios/Pods/Headers/Public/React-jsiexecutor/jsireact/JSIExecutor.h:133:3: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
std::optional<jsi::Function> flushedQueue_;
^
Changing the C++ dialect setting to match the new React Native c++17 default seems to resolve this issue. We, like others, are stuck on Reanimated 2.x due to react-native-vision-camera.
Steps to reproduce
- Create a bare React Native project on 0.72.0-rc.5
- Ensure that it build successfully on iOS
- Install Reanimated 2.17.0
- Attempt to build on iOS again
Snack or a link to a repository
Reanimated version
2.17.0
React Native version
0.72.0-rc.5
Platforms
iOS
JavaScript runtime
None
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Reacted by Lukas, Avinash Kumar, Michael Perhats, JapeshFlyFin, Romick2005, Kaic Bastidas, Artur Zahorskyi, tony chen, Alex Khaylo, Kaung-Htet-Hein and 6 more
Metadata
Metadata
Assignees
Labels
Needs reviewIssue is ready to be reviewed by a maintainerIssue is ready to be reviewed by a maintainerPlatform: iOSThis issue is specific to iOSThis issue is specific to iOSRepro providedA reproduction with a snippet of code, snack or repo is providedA reproduction with a snippet of code, snack or repo is provided
Activity
tomekzaw commentedon Jun 2, 2023
Hey @jbrowning, thanks for reporting this issue. Currently, Reanimated 2 doesn't support 0.72.0-rc.5, but Reanimated 3 does with this patch #4523 so please upgrade if possible 🙏
[-]iOS: Version 2.17.0 fails to built on React Native 0.72.0-rc.5[/-][+]iOS: Version 2.17.0 fails to build on React Native 0.72.0-rc.5[/+]AlexanderEggers commentedon Jun 20, 2023
@tomekzaw Do you have any plans to add RN 0.72 support for Reanimated 2? My project won't be able to upgrade to Reanimated 3 any time soon but we would like to keep using the latest RN version.
sylvainbaronnet commentedon Jun 21, 2023
same, is there a patch to add support for v2 ?
tomekzaw commentedon Jun 29, 2023
@AlexanderEggers Can I ask you what's the reason why your project is not able to upgrade to Reanimated 3?
sylvainbaronnet commentedon Jun 29, 2023
Hi @tomekzaw , If I remember well, I think in my case it was an issue with https://github.com/dohooo/react-native-reanimated-carousel maybe with react-native-gesture-handler too
AlexanderEggers commentedon Jun 29, 2023
@tomekzaw This is our current blocker: #4613 Everything else seems to run fine for us.
tomekzaw commentedon Jun 29, 2023
@AlexanderEggers Thanks for quick response. I think it's way easier for us to resolve this issue than to backport support for 0.72 to v2 😄 Will take a look at it again soon.
tomekzaw commentedon Jun 29, 2023
@sylvainbaronnet Can you please post a link to the specific issue?
sylvainbaronnet commentedon Jun 29, 2023
I will try again today to tell you exactly what's the issue
sylvainbaronnet commentedon Jun 30, 2023
@tomekzaw I successfully upgraded to v3 (on RN 0.71) so all good for me (I must have already upgraded other packages that had issues with v3 in the past or it's the latest v3 that fixed it)
camilossantos2809 commentedon Jun 30, 2023
Are there plans to add support for react-native v0.72 in reanimated v2?
Currently I cannot update reanimated to v3 in my projects as vision-camera is not yet compatible with that version.
43 remaining items
tomekzaw commentedon Sep 14, 2023
@hemantgogia09
std::optionalwas introduced in C++17, can you confirm you're using it and not C++14? Which version of react-native are you using?hemantgogia09 commentedon Sep 14, 2023
i am using react-native
0.72.4. How do i check which C++ version am i using?hemantgogia09 commentedon Sep 15, 2023
@tomekzaw sorry for bump any guidance that you can give here? I am stuck without this upgrade.
Romick2005 commentedon Sep 18, 2023
Hi @tomekzaw, I got this error running on latest [email protected], [email protected] and [email protected] that should support reanimated@V3. It works fine for iOS build, but fails on Android build.
Romick2005 commentedon Sep 19, 2023
Just checked latest [email protected] and [email protected] and it works for me!
Thank you @tomekzaw for updating C++14 to C++17!
Skizu commentedon Sep 19, 2023
Using JSC and/or having an application
minSdkVersionof anything but 21 (i.e. 24 forreact-native-webrtc) results in build failures.It appears that if hermes is disabled
react-native-reanimated'sbuild.gradlestill evaluatesFOR_HERMEStotrue.UlisesGallardo commentedon Sep 19, 2023
For me it is still not working with [email protected] and [email protected] and [email protected] , similar to @Romick2005 , but I tried with [email protected] and it worked
UlisesGallardo commentedon Sep 19, 2023
Even if it works with [email protected] , I have another problem: ERROR Error: Reanimated V3 is not installed, Frame Processors are not available!, js engine: hermes
Skizu commentedon Sep 27, 2023
Bump
piaskowyk commentedon Sep 28, 2023
To sum up:
TarifEzaz commentedon Oct 18, 2023
How this can be done?
CelinaJa commentedon Nov 8, 2023
For me, this resulted in
error Couldn't find match for "e323a61d360ba70d30ecf8522e515a6270225db0"Using
yarn add tomekzaw/react-native-vision-camera#refs/heads/v2instead worked for me! Probably because the PR has been merged.tomekzaw commentedon Nov 8, 2023
@CelinaJa The PR was merged so you can use
[email protected].aliustaoglu commentedon Jan 30, 2024
You gotta do this in
node_modules/react-native-reanimated/RNReanimated.podspec. And then patch the package so that it will be re-applied whenever you do a new yarn install. I can confirm this way works.