https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md
I refer to the page above and I am working on the "react native turbo module" project.
I created the rtn-calculator
in the example as a github repository and installed it in my project.
- The guide document I referred to
https://github.com/reactwg/react-native-new-architecture/blob/main/docs/turbo-modules.md
- How to reproduce for errors
- Run the git clone
git clone https://github.com/wisdomstar94/react_native_sample_app.git
- Move Terminal to Cloned Project
cd react_native_sample_app
- npm install
npm i
- Move to the terminal folder
cd ./ios
- Run the pod install command as shown below to activate the new architecture of "react native"
bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
(Source of the above command : https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md#enable-new-architecture-for-ios) - When the ios emulator is ready, run the ios app using the command below.
npm run ios
- This results in the following error.
......** BUILD FAILED **The following build commands failed: CompileC /Users/jaehyeonshin/Library/Developer/Xcode/DerivedData/react_native_sample_app-gomarbdmonztkscgyahbghqfrpvu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/rtn-calculator.build/Objects-normal/arm64/RTNCalculator.o /Users/jaehyeonshin/Documents/projects_react_native/react_native_sample_app/node_modules/rtn-calculator/ios/RTNCalculator.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'rtn-calculator' from project 'Pods')(1 failure)
Why does "rtn-calculator" fail when building?
My "rtn-calculator" turbo module code can be found at "https://github.com/wisdomstar94/rtn-calculator".
Tested on Android with the npm run android
command, it works fine. Error only with ios.