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

Issue: React Native BigNumber 0.2.3 incompatibility with Expo 51 and React Native 0.75.0 #69

Open
dexterslabor opened this issue Sep 25, 2024 · 0 comments · May be fixed by #70
Open

Issue: React Native BigNumber 0.2.3 incompatibility with Expo 51 and React Native 0.75.0 #69

dexterslabor opened this issue Sep 25, 2024 · 0 comments · May be fixed by #70

Comments

@dexterslabor
Copy link

dexterslabor commented Sep 25, 2024

Environment

  • Expo version: 51
  • React Native version: 0.75.0
  • react-native-bignumber version: 0.2.3
  • Xcode version: 16

Description

When using react-native-bignumber 0.2.3 with Expo 51 and React Native 0.75.0, there's an incompatibility issue that requires manual patching of the react-native-bignumber.podspec file.

First, I want to express my appreciation for this amazing project. It has really helped me speed up development, especially with features like quick-crypto. Thank you for your hard work on this valuable tool.

Steps to Reproduce

  1. Set up a project with Expo 51 and React Native 0.75.0
  2. Install [email protected]
  3. Attempt to build the project

Expected Behavior

The project should build successfully without any manual modifications.

Actual Behavior

The build fails due to incompatibility issues with the react-native-bignumber.podspec file. Specifically, the xcodebuild command exits with error code 65. Here's the detailed error message:

› Compiling react-native-bignumber Pods/react-native-bignumber » MGBigNumberHostObject.cpp
› Compiling react-native-bignumber Pods/react-native-bignumber » BigNumberModule.mm
❌ fatal error: too many errors emitted, stopping now [-ferror-limit=]
› Compiling Pods/ReactCodegen » safeareacontextJSI-generated.cpp
› Compiling Pods/ReactCodegen » safeareacontext-generated.mm
› Compiling Pods/ReactCodegen » rnsvgJSI-generated.cpp
› Compiling Pods/ReactCodegen » rnsvg-generated.mm
› Compiling Pods/ReactCodegen » rnscreensJSI-generated.cpp
› Compiling Pods/ReactCodegen » rnscreens-generated.mm
› Compiling Pods/ReactCodegen » rnreanimatedJSI-generated.cpp
› Compiling Pods/ReactCodegen » rnreanimated-generated.mm
Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'React-FabricComponents' from project 'Pods')
Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'EXConstants' from project 'Pods')
› 1 error(s), and 4 warning(s)
CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.

Solution

A post-install script is required to patch the react-native-bignumber.podspec file. The patch adds the CLANG_CXX_LANGUAGE_STANDARD configuration to set the C++ standard to c++17.

Here's the diff of the changes:

--- node_modules/react-native-bignumber/react-native-bignumber.podspec 2024-09-24 12:57:52
+++ node_modules/react-native-bignumber/react-native-bignumber.podspec 2024-09-24 11:57:23
@@ -32,7 +32,8 @@
 "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 = {
- "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\""
+ "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\"",
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
 }
 s.dependency "OpenSSL-Universal", "~> 1.1.180"

Proposed Fix

Update the react-native-bignumber.podspec file in version 0.2.3 (and potentially future versions) to include the CLANG_CXX_LANGUAGE_STANDARD configuration by default, setting it to "c++17".

Additional Notes

This issue affects projects using react-native-bignumber 0.2.3 with newer versions of Expo and React Native. Implementing this fix in the package itself would prevent the need for manual patching and improve compatibility with current and future versions of Expo and React Native.

Once again, thank you for this fantastic project. Features like quick-crypto have been instrumental in speeding up our development process. We're looking forward to continuing to use and contribute to this project.

@dexterslabor dexterslabor linked a pull request Sep 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant