skip to Main Content

I’ve been running "pod install" in my project to connect my dependencies but I’ve been getting this error: Can't merge user_target_xcconfig for pod targets: ["Reanimated", "hermes-engine"] Singular build setting CLANG_CXX_LIBRARY has different values. everytime I run pod. I tried to work around this error, I’ve deleted and reinstalled all pod files as well but no luck.

Wondering if anyone found a solution for this ?

6

Answers


  1. Happy update! reanimated 2.10.0 is released now, and it appears to have the required patch according to a timely comment from @Lauri-Harpf – 2.10.0 also contains pre-built libs (as required by reanimated 2.x) for react-native 0.70.x so this answer is largely obsolete, but in a good way. Go grab the new release and give a star to the repo + support Software Mansion if you can, as they do a great job on the module. Cheers

    Mostly obsolete answer follows:


    react-native 0.69

    It appears the answer is to update react-native-reanimated in order for it to be more compatible with react-native 0.69

    There is not an official release with it for react-native 0.69 (for react-native 0.70 see below), but patch-package may be used to integrate a fix as described here:

    https://github.com/software-mansion/react-native-reanimated/issues/3326#issuecomment-1225057452

    (basically, you forcefully alter the C++ language standard reanimated uses by altering it’s podspec file to be the one Hermes wants, using patch-package to do the whole thing cleanly.

    diff --git a/node_modules/react-native-reanimated/RNReanimated.podspec b/node_modules/react-native-reanimated/RNReanimated.podspec
    index d53cb12..719f813 100644
    --- a/node_modules/react-native-reanimated/RNReanimated.podspec
    +++ b/node_modules/react-native-reanimated/RNReanimated.podspec
    @@ -94,7 +94,7 @@ Pod::Spec.new do |s|
       }
       s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
       s.xcconfig               = {
    -    "CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
    +    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
         "HEADER_SEARCH_PATHS" => ""$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/glog" "$(PODS_ROOT)/#{folly_prefix}Folly" "${PODS_ROOT}/Headers/Public/React-hermes" "${PODS_ROOT}/Headers/Public/hermes-engine"",
                                    "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags  }
    

    react-native 0.70

    For react-native 0.70, you need to use the 3.x versions of react-native-reanimated, which do not have an official release as of this writing.

    You do that by installing the react-native-reanimated@next version, for example as yarn add react-native-reanimated@next, then pod install and the error should be gone.

    Login or Signup to reply.
  2. Simple Answer is
    Just set the CXX n the podspec.

    node_modules/react-native-reanimated/RNReanimated.podspec
    

    Change to:

    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
    

    Credits => https://github.com/Shopify/react-native-skia/issues/405#issuecomment-1244302303

    Login or Signup to reply.
  3. I just needed to update to reanimated to v3.0.0-rc.3

    Login or Signup to reply.
  4. I came across this error by installing:

    • react-native: 0.70.2
    • react-navigation v6
    • react-native-reanimated 2.10.0
    • "@react-navigation/drawer": "^6.5.0",
    • "@react-navigation/native": "^6.0.13",
    • "@react-navigation/native-stack": "^6.9.0",

    React-Navigation does not mention any support yet for Animate V3 or Animate (next).

    And as far as I heard, there is some major change on how Animate works behind the curtons (v2 and v3)

    So I changed like mentioned in the post above the c++ version, made with patch-package a patch, and build the react native apps for android and iOS like mentioned on the react-native docs.
    And I can confirm everything worked just fine.

    I didn’t know at this point in time how patch-package worked, here some video in case you might also be new to this:
    https://www.youtube.com/watch?v=2AVs-Yh1bS8&t=3s&ab_channel=BenAwad

    Login or Signup to reply.
  5. Fixed for expo eas build on SDK 46 by updating to reanimated 2.12.0

    Still throws error regarding CLANG_LANGUAGE_STANDARD and CLANG_LIBRARY for ["Reanimated" , "hermes-engine"] but not anymore for ["RNReanimated", "Reanimated", "hermes-engine"].

    The build was crashing on startup in testflight, but does not do that anymore.

    Login or Signup to reply.
  6. FWIW, in case you use Expo with expo-dev-client, expo-dev-menu pulls in a bundled react-native-reanimated. This is where the error is coming from in my case. It should be fixed, but at least a fresh Expo project I created yesterday still sports the issue, so the fix must not be released yet. The warning/error is gone after patching the podspec.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search