margelo / react-native-bignumber

🔢 The fastest Big Number library for React Native
https://margelo.io
MIT License
337 stars 11 forks source link

Can't merge user_target_xcconfig for pod targets: ["react-native-bignumber", "react-native-quick-crypto"] #65

Open emenocal07 opened 3 months ago

emenocal07 commented 3 months ago

Hi! 👋

Firstly, thanks for your work on this project!

Today I used patch-package to patch react-native-bignumber@0.2.2 for the project I'm working on.

Upon running 'pod install', we encountered the following warning message: [!] Can't merge user_target_xcconfig for pod targets: ["react-native-bignumber", "react-native-quick-crypto"]. Singular build setting CLANG_CXX_LANGUAGE_STANDARD has different values.

To resolve this, I patched the package and set the CLANG_CXX_LANGUAGE_STANDARD to "c++17" for the 'react-native-bignumber' pod. This adjustment successfully addressed the conflict and allowed the 'pod install' command to complete without any further issues. Here is the diff that solved my problem:

diff --git a/node_modules/react-native-bignumber/react-native-bignumber.podspec b/node_modules/react-native-bignumber/react-native-bignumber.podspec
index d9fbaea..d8e6d38 100644
--- a/node_modules/react-native-bignumber/react-native-bignumber.podspec
+++ b/node_modules/react-native-bignumber/react-native-bignumber.podspec
@@ -32,7 +32,7 @@ Pod::Spec.new do |s|
     "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\"  \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" "
   }
   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}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\""
   }

This issue body was partially generated by patch-package.

shamilovtim commented 3 months ago

Fixed by #64 as soon as it's released and @boorad also fixed this in quick crypto

I believe modifying xcconfig files is simply the culprit here. I think these modifications are unnecessary.

So while "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" does fix the issue temporarily, ultimately removing the whole line will stop these conflicts from happening in the future.