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

Switch from 14 to 17 for 0.69 RN #3326

Closed
billnbell opened this issue Jun 27, 2022 · 14 comments
Closed

Switch from 14 to 17 for 0.69 RN #3326

billnbell opened this issue Jun 27, 2022 · 14 comments
Labels
Missing info The user didn't precise the problem enough Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@billnbell
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-reanimated/RNReanimated.podspec b/node_modules/react-native-reanimated/RNReanimated.podspec
index 33ea1c6..da5ed40 100644
--- a/node_modules/react-native-reanimated/RNReanimated.podspec
+++ b/node_modules/react-native-reanimated/RNReanimated.podspec
@@ -79,7 +79,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  }
 
diff --git a/node_modules/react-native-reanimated/lib/reanimated2/jestUtils.js b/node_modules/react-native-reanimated/lib/reanimated2/jestUtils.js
index 5ae42ec..8c7f631 100644
--- a/node_modules/react-native-reanimated/lib/reanimated2/jestUtils.js
+++ b/node_modules/react-native-reanimated/lib/reanimated2/jestUtils.js
@@ -145,7 +145,7 @@ export const advanceAnimationByFrame = (count) => {
     jest.advanceTimersByTime(frameTime);
 };
 export const setUpTests = (userConfig = {}) => {
-    const expect = require('expect');
+    const { expect } = require('@jest/globals');
     require('setimmediate');
     frameTime = Math.round(1000 / config.fps);
     config = Object.assign(Object.assign({}, config), userConfig);

This issue body was partially generated by patch-package.

@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided Missing info The user didn't precise the problem enough labels Jun 27, 2022
@github-actions
Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Snack or minimal code example, Package versions and Affected platforms sections.

@piaskowyk
Copy link
Member

Hey, I have already merged a fix for it, it will be available in the next release. #3347

@faroutchris
Copy link

@piaskowyk I think this patch also makes sure to fix this warning when running pod install, besides the jest fix

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

@billnbell
Copy link
Author

OK for

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

For latest React Native it requires that one. Not sure if we can make it dynamic based on version ?

@shensven
Copy link

shensven commented Jul 6, 2022

I got the following waring x4 when I set :hermes_enabled => true in ios/Podfile

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

I am sure I've set CLANG_CXX_LANGUAGE_STANDARD = "c++17" in both debug and release in the buildSettings section.

name version
react-native 0.69.1
react-native-reanimated 2.9.1
NodeJS v16.15.1
Xcode Version 13.4.1 (13F100)

@codeOlam
Copy link

I am getting same error when i installed the latest version of react-native-reanimated: [email protected] and when i downgraded to [email protected], i still got [!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

  • react => v18.0.0
  • react-native => v0.69.1
  • Node => v18.0.0
  • Xcode => v13.2.1 (13C100)

Is there any fix or work around for this yet?

@jayfeldman12
Copy link

@codeOlam, you can use patch-package as described in the original post as a workaround, and hopefully a new version will be released soon and the patch-package file can be deleted after upgrading.

@codeOlam
Copy link

Thank you JayFeldman12. I was able to get a fix yesterday. by following this solution: #3305 (comment). I also had to install NDK(side-by-side) and CMake via android studio.

@emmadal
Copy link

emmadal commented Aug 24, 2022

i had the same problem, in node_modules/react-native-reanimated/RNReanimated.podspec change "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" to "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
then use

npx patch-package react-native-reanimated

to patch your new changes

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  }

You can see below my react-native-reanimated+2.10.0.patch files

@josemojena
Copy link

After the update to react-reanimated to the 2.10.0 version, I am still getting the warning when running pod install. Any suggestions?

@emmadal
Copy link

emmadal commented Sep 3, 2022

After the update to react-reanimated to the 2.10.0 version, I am still getting the warning when running pod install. Any suggestions?

please read this #3326 (comment)

@malikhamza0546
Copy link

"react-native-reanimated": "^3.0.0-rc.3", just install this version of reac-native-reanimated package, your problem will be solved.

@YohayBar
Copy link

installed 2.13.0 and problem was solved :)

@nandorojo
Copy link
Contributor

nandorojo commented Feb 8, 2023

@piaskowyk I think this patch also makes sure to fix this warning when running pod install, besides the jest fix

[!] Can't merge user_target_xcconfig for pod targets: ["RNReanimated", "hermes-engine"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

Weirdly I'm still getting this problem with version 2.14.4 when Hermes is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests