Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: Version 2.17.0 fails to build on React Native 0.72.0+ #4522

Closed
jbrowning opened this issue Jun 1, 2023 · 67 comments
Closed

iOS: Version 2.17.0 fails to build on React Native 0.72.0+ #4522

jbrowning opened this issue Jun 1, 2023 · 67 comments
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@jbrowning
Copy link

jbrowning commented Jun 1, 2023

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

  1. Create a bare React Native project on 0.72.0-rc.5
  2. Ensure that it build successfully on iOS
  3. Install Reanimated 2.17.0
  4. Attempt to build on iOS again

Snack or a link to a repository

https://github.com/jbrowning/RN072Reanimated2

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

@jbrowning jbrowning added the Needs review Issue is ready to be reviewed by a maintainer label Jun 1, 2023
@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided Platform: iOS This issue is specific to iOS labels Jun 1, 2023
@tomekzaw
Copy link
Member

tomekzaw commented 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 🙏

@jbrowning jbrowning changed the title 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 Jun 2, 2023
@AlexanderEggers
Copy link
Contributor

@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
Copy link

same, is there a patch to add support for v2 ?

@tomekzaw
Copy link
Member

My project won't be able to upgrade to Reanimated 3 any time soon

@AlexanderEggers Can I ask you what's the reason why your project is not able to upgrade to Reanimated 3?

@sylvainbaronnet
Copy link

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
Copy link
Contributor

AlexanderEggers commented Jun 29, 2023

@tomekzaw This is our current blocker: #4613 Everything else seems to run fine for us.

@tomekzaw
Copy link
Member

@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
Copy link
Member

@sylvainbaronnet Can you please post a link to the specific issue?

@sylvainbaronnet
Copy link

I will try again today to tell you exactly what's the issue

@sylvainbaronnet
Copy link

sylvainbaronnet commented 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
Copy link
Contributor

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.

@Ar-Shak
Copy link

Ar-Shak commented Jun 30, 2023

Similar to @camilossantos2809 I cannot update reanimated to v3 in my project due to react-native-vision-camera and its plugin vision-camera-code-scanner.

@martan-fitsense
Copy link

Similar to @arshak-kahnputers I'm blocked by reanimated v3 and my project cannot be built successfully cuz I'm using react-native-vision-camera too.

@sebastien-abbal
Copy link

Same for me ... HELP !

@AlexanderEggers
Copy link
Contributor

@tomekzaw We found another blocker for updating to v3.. it seems like that the useAnimatedProps hook is broken in v3. I will try to create an issue for that in the next days including an example to reproduce that.

@metrix-hu
Copy link

@tomekzaw We are also in the VisionCamera situation.

@tomekzaw
Copy link
Member

tomekzaw commented Jul 5, 2023

@metrix-hu Thanks for the update, that's exactly what I'm working on currently so fingers crossed!

@metrix-hu
Copy link

@tomekzaw I am crossing them hard, because I am really stuck now. react-native complained about the update, so I did. For that I modified at least 20 files in my project and I do not really want to revert them 😄 I am working on Android right now though. Thank you very much for looking at it!

@metrix-hu
Copy link

metrix-hu commented Jul 5, 2023

I also tried to update everything to V3 but vision-camera is really in early stages especially on Android. I tried modifying its files here and there but couldnt make it to build.

@tectiv3
Copy link

tectiv3 commented Jul 6, 2023

Simply changing the dialect fixes the issue

image

@metrix-hu
Copy link

@tectiv3 Can we set it somehow for android too?

@paulschoen
Copy link

paulschoen commented Jul 6, 2023

Simply changing the dialect fixes the issue

image

I can confirm this does fix it. Only issue is when you have a remote CI server that does a pod install it can't change the pod file dialect. Can this be a minor release just to change this?

In my project I'm also using is vision-camera

@paulschoen
Copy link

Simply changing the dialect fixes the issue
image

I can confirm this does fix it. Only issue is when you have a remote CI server that does a pod install it can't change the pod file dialect. Can this be a minor release just to change this?

In my project I'm also using is vision-camera

The fix for iOS should be on version v2.17.0

# RNReanimated.podspec

  s.pod_target_xcconfig = {
    "USE_HEADERMAP" => "YES",
    "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" ",
    "FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
  }

@tomekzaw
Copy link
Member

@lexer Thanks for the response. We're actively working on it. Reanimated 3.5.0 will expose API that RNVisionCamera v2/v3 will use for frame processors. Any other libraries?

@Nox04
Copy link

Nox04 commented Aug 29, 2023

@tomekzaw This carousel library is blocking some of our projects too: https://github.com/dohooo/react-native-reanimated-carousel

Should the fix you're working on, work for it too?

@tomekzaw
Copy link
Member

@Nox04 What exactly seems to be the blocker? It looks like react-native-reanimated-carousel uses Reanimated 2 API which is essentially the same as in Reanimated v3. Do you have some error message that you can paste here?

@Nox04
Copy link

Nox04 commented Aug 29, 2023

@tomekzaw I wasn't aware of that. I'll try to use the carousel library with reanimated 3 and see if that works. Thanks for the answer!

@jbrowning jbrowning changed the title iOS: Version 2.17.0 fails to build on React Native 0.72.0-rc.5 iOS: Version 2.17.0 fails to build on React Native 0.72.0+ Aug 29, 2023
@dmackinn
Copy link

The frame processor issue also blocks me from upgrading my projects. Using this alongside react-native-vision-camera and vision-camera-code-scanner

@1fabiopereira
Copy link

1fabiopereira commented Aug 30, 2023

@lexer Thanks for the response. We're actively working on it. Reanimated 3.5.0 will expose API that RNVisionCamera v2/v3 will use for frame processors. Any other libraries?

Are there any expectations or predictions of how soon this will be available?

@piaskowyk
Copy link
Member

Everything is ready from our side, we just preparing for the release - most probably next week.

@bneigher
Copy link

🙏

@ikurowski
Copy link

any updates?

@tomekzaw
Copy link
Member

tomekzaw commented Sep 13, 2023

any updates?

  1. Upgrade Reanimated to 3.5.1
yarn add react-native-reanimated@^3.5.1
  1. Install RNVisionCamera from this PR: feat: Reanimated v3 support in RNVisionCamera v2 mrousavy/react-native-vision-camera#1759
yarn add tomekzaw/react-native-vision-camera#e323a61d360ba70d30ecf8522e515a6270225db0
  1. Don't forget to run pod install and yarn start --reset-cache.

@pabloluz
Copy link

pabloluz commented Sep 14, 2023

@tomekzaw I can confirm it's working on iOS. Thank you.

@hemantgogia09
Copy link

@tomekzaw Hi, thanks for your work. I tried the PR build and reanimated version you suggested and ios is working fine now but i am getting error while trying to run android.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android/.cxx/Debug/1k4n4t6j/arm64-v8a'
  [1/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JHashMap.cpp.o
  [2/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JImageProxy.cpp.o
  [3/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JFrameProcessorPlugin.cpp.o
  [4/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCameraScheduler.cpp.o
  [5/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o
  [6/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o
  [7/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o
  FAILED: CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o 
  /Users/hemantgogia/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/Users/hemantgogia/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DVisionCamera_EXPORTS -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon/callinvoker -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon/jsi -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon/react/renderer/graphics/platform/cxx -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon/runtimeexecutor -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native/ReactCommon/yoga -I/Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android/src/main/cpp -isystem /Users/hemantgogia/.gradle/caches/transforms-3/0eba9a168eb8819dccb7829f2ba40fb2/transformed/jetified-hermes-android-0.72.4-debug/prefab/modules/libhermes/include -isystem /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/folly_runtime/include -isystem /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/glog/include -isystem /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/jsi/include -isystem /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/reactnativejni/include -isystem /Users/hemantgogia/.gradle/caches/transforms-3/34c2120d0d3cd8dc97826fc02c9e8fc4/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/include -isystem /Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-reanimated/android/build/prefab-headers/reanimated -fexceptions -frtti -std=c++1y -DONANDROID -DFOR_HERMES=1 -g  -fno-limit-debug-info -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o -MF CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o.d -o CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o -c /Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android/src/main/cpp/JSIJNIConversion.cpp
  In file included from /Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android/src/main/cpp/JSIJNIConversion.cpp:17:
  /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/reactnativejni/include/react/jni/ReadableNativeMap.h:41:3: error: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
    std::optional<folly::dynamic> keys_;
    ^~~~~
  /Users/hemantgogia/.gradle/caches/transforms-3/6fe00d6361b0f0c55549aec89a7f6742/transformed/jetified-react-android-0.72.4-debug/prefab/modules/folly_runtime/include/folly/Optional.h:102:7: note: 'folly::Optional' declared here
  class Optional {
        ^
  1 error generated.
  [8/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/CameraView.cpp.o
  [9/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Users/hemantgogia/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android/.cxx/Debug/1k4n4t6j/arm64-v8a \
        VisionCamera
    from /Users/hemantgogia/Documents/hemant/umee/crm/packages/mobile/node_modules/react-native-vision-camera/android

Any idea what am i missing here? Thanks.

@tomekzaw
Copy link
Member

@hemantgogia09 std::optional was introduced in C++17, can you confirm you're using it and not C++14? Which version of react-native are you using?

@hemantgogia09
Copy link

@hemantgogia09 std::optional was introduced in C++17, can you confirm you're using it and not C++14? Which version of react-native are you using?

i am using react-native 0.72.4. How do i check which C++ version am i using?

@hemantgogia09
Copy link

@tomekzaw sorry for bump any guidance that you can give here? I am stuck without this upgrade.

@Romick2005
Copy link

Hi @tomekzaw, I got this error running on latest react-native@0.72.4, react-native-reanimated@3.5.2 and react-native-vision-camera@2.16.0 that should support reanimated@V3. It works fine for iOS build, but fails on Android build.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-vision-camera:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/user/project/node_modules/react-native-vision-camera/android/.cxx/Debug/4s5y5b3c/arm64-v8a'
  [1/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JHashMap.cpp.o
  [2/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JImageProxy.cpp.o
  [3/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/java-bindings/JFrameProcessorPlugin.cpp.o
  [4/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCameraScheduler.cpp.o
  [5/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/VisionCamera.cpp.o
  [6/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameHostObject.cpp.o
  [7/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o
  FAILED: CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o 
  /Users/user/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --sysroot=/Users/user/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DVisionCamera_EXPORTS -I/Users/user/project/node_modules/react-native/ReactAndroid/src/main/jni/react/turbomodule -I/Users/user/project/node_modules/react-native/ReactCommon -I/Users/user/project/node_modules/react-native/ReactCommon/callinvoker -I/Users/user/project/node_modules/react-native/ReactCommon/jsi -I/Users/user/project/node_modules/react-native/ReactCommon/react/renderer/graphics/platform/cxx -I/Users/user/project/node_modules/react-native/ReactCommon/runtimeexecutor -I/Users/user/project/node_modules/react-native/ReactCommon/yoga -I/Users/user/project/node_modules/react-native-vision-camera/android/src/main/cpp -isystem /Users/user/.gradle/caches/transforms-3/00f2500bc865ce1c87c6a8f62f269c59/transformed/jetified-hermes-android-0.72.4-debug/prefab/modules/libhermes/include -isystem /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/folly_runtime/include -isystem /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/glog/include -isystem /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/jsi/include -isystem /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/reactnativejni/include -isystem /Users/user/.gradle/caches/transforms-3/eeb7a76cc0d2c5a8cc81cab965bba0b1/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/include -isystem /Users/user/project/node_modules/react-native-reanimated/android/build/prefab-headers/reanimated -fexceptions -frtti -std=c++1y -DONANDROID -DFOR_HERMES=1 -g  -fno-limit-debug-info -fPIC -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o -MF CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o.d -o CMakeFiles/VisionCamera.dir/src/main/cpp/JSIJNIConversion.cpp.o -c /Users/user/project/node_modules/react-native-vision-camera/android/src/main/cpp/JSIJNIConversion.cpp
  In file included from /Users/user/project/node_modules/react-native-vision-camera/android/src/main/cpp/JSIJNIConversion.cpp:17:
  /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/reactnativejni/include/react/jni/ReadableNativeMap.h:41:3: error: no template named 'optional' in namespace 'std'; did you mean 'folly::Optional'?
    std::optional<folly::dynamic> keys_;
    ^~~~~
  /Users/user/.gradle/caches/transforms-3/53f4b2980c6436229b017cee53292244/transformed/jetified-react-android-0.72.4-debug/prefab/modules/folly_runtime/include/folly/Optional.h:102:7: note: 'folly::Optional' declared here
  class Optional {
        ^
  1 error generated.
  [8/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/FrameProcessorRuntimeManager.cpp.o
  [9/10] Building CXX object CMakeFiles/VisionCamera.dir/src/main/cpp/CameraView.cpp.o
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Users/user/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/user/project/node_modules/react-native-vision-camera/android/.cxx/Debug/4s5y5b3c/arm64-v8a \
        VisionCamera
    from /Users/user/project/node_modules/react-native-vision-camera/android

@Romick2005
Copy link

Romick2005 commented Sep 19, 2023

Just checked latest react-native-vision-camera@2.16.1 and react-native-reanimated@3.5.2 and it works for me!
Thank you @tomekzaw for updating C++14 to C++17!

@Skizu
Copy link

Skizu commented Sep 19, 2023

Using JSC and/or having an application minSdkVersion of anything but 21 (i.e. 24 for react-native-webrtc) results in build failures.

It appears that if hermes is disabled react-native-reanimated's build.gradle still evaluates FOR_HERMES to true.

@UlisesGallardo
Copy link

UlisesGallardo commented Sep 19, 2023

For me it is still not working with react-native-vision-camera@2.16.1 and react-native-reanimated@3.5.2 and react-native@0.72.4 , similar to @Romick2005 , but I tried with react-native@0.72.0 and it worked

@UlisesGallardo
Copy link

Even if it works with react-native-reanimated@3.5.2 , I have another problem: ERROR Error: Reanimated V3 is not installed, Frame Processors are not available!, js engine: hermes

For me it is still not working with react-native-vision-camera@2.16.1 and react-native-reanimated@3.5.2 and react-native@0.72.4 , similar to @Romick2005 , but I tried with react-native@0.72.0 and it worked

@Skizu
Copy link

Skizu commented Sep 27, 2023

Bump

@piaskowyk
Copy link
Member

piaskowyk commented Sep 28, 2023

To sum up:

  • Reanimated 2.17.0 doesn't support react-native@0.72
  • Reanimated 3+ supports react-native@0.72
  • Reanimated 3.5.4 supports react-native-vision-camera@^2.16.1

@TarifEzaz
Copy link

Simply changing the dialect fixes the issue
image

I can confirm this does fix it. Only issue is when you have a remote CI server that does a pod install it can't change the pod file dialect. Can this be a minor release just to change this?
In my project I'm also using is vision-camera

The fix for iOS should be on version v2.17.0

# RNReanimated.podspec

  s.pod_target_xcconfig = {
    "USE_HEADERMAP" => "YES",
    "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" ",
    "FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
  }

How this can be done?

@CelinaJa
Copy link

CelinaJa commented Nov 8, 2023

any updates?

  1. Upgrade Reanimated to 3.5.1
yarn add react-native-reanimated@^3.5.1
  1. Install RNVisionCamera from this PR: feat: Reanimated v3 support in RNVisionCamera v2 mrousavy/react-native-vision-camera#1759
yarn add tomekzaw/react-native-vision-camera#e323a61d360ba70d30ecf8522e515a6270225db0
  1. Don't forget to run pod install and yarn start --reset-cache.

For me, this resulted in error Couldn't find match for "e323a61d360ba70d30ecf8522e515a6270225db0"
Using yarn add tomekzaw/react-native-vision-camera#refs/heads/v2 instead worked for me! Probably because the PR has been merged.

@tomekzaw
Copy link
Member

tomekzaw commented Nov 8, 2023

@CelinaJa The PR was merged so you can use react-native-vision-camera@2.16.5.

@aliustaoglu
Copy link

Simply changing the dialect fixes the issue
image

I can confirm this does fix it. Only issue is when you have a remote CI server that does a pod install it can't change the pod file dialect. Can this be a minor release just to change this?
In my project I'm also using is vision-camera

The fix for iOS should be on version v2.17.0

# RNReanimated.podspec

  s.pod_target_xcconfig = {
    "USE_HEADERMAP" => "YES",
    "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" ",
    "FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"",
    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
  }

How this can be done?

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.

npx patch-package react-native-reanimated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs review Issue is ready to be reviewed by a maintainer Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests