Reputation: 51
i am having my react native project with version 0.64.4 now i am trying to set up this project in my new mac book but when i run npx react-native run-ios i get this error but when i tried to run this app in macbook intel chip laptop it runs successfully but faces this issues in macbook m1 chip laptop(i tried pod install it is installed correctly)
my enviroment info
react-native info
System:
OS: macOS 13.1
CPU: (8) arm64 Apple M1
Memory: 113.38 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.6.0 - /opt/homebrew/bin/node
Yarn: Not Found
npm: 9.4.0 - /opt/homebrew/bin/npm
Watchman: 2023.02.06.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/accelerlabsolutions/.rvm/gems/ruby-2.7.6/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9477386
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.17 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: ^0.64.1 => 0.64.4
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
npx react-native run-ios
Error
"_swift_unknownObjectWeakInit", referenced from:
_$s9InputMask23MaskedTextFieldDelegateC13primaryFormat12autocomplete0I7OnFocus8autoskip11rightToLeft13affineFormats27affinityCalculationStrategy15customNotations02oncD15ChangedCallback16allowSuggestionsACSS_S4bSaySSGAA08AffinitysT0OSayAA8NotationVGySo06UITextA0_p_SSSbtcSgSbtcfc in libInputMask.a(MaskedTextFieldDelegate.o)
_$s9InputMask23MaskedTextFieldDelegateCACycfc in libInputMask.a(MaskedTextFieldDelegate.o)
_$s9InputMask22MaskedTextViewDelegateC13primaryFormat12autocomplete0I7OnFocus8autoskip11rightToLeft13affineFormats27affinityCalculationStrategy15customNotations02oncD15ChangedCallback16allowSuggestionsACSS_S4bSaySSGAA08AffinitysT0OSayAA8NotationVGySo06UITextA0_p_SSSbtcSgSbtcfc in libInputMask.a(MaskedTextViewDelegate.o)
_$s9InputMask22MaskedTextViewDelegateCACycfc in libInputMask.a(MaskedTextViewDelegate.o)
_$s9InputMask010MaskedTextA8ListenerC13primaryFormat12autocomplete0H7OnFocus8autoskip11rightToLeft13affineFormats27affinityCalculationStrategy15customNotations02oncD15ChangedCallback16allowSuggestionsACSS_S4bSaySSGAA08AffinityrS0OSayAA8NotationVGySo06UITextA0_p_SSSbtcSgSbtcfc in libInputMask.a(MaskedTextInputListener.o)
_$s9InputMask010MaskedTextA8ListenerCACycfc in libInputMask.a(MaskedTextInputListener.o)
"_swift_unknownObjectWeakLoadStrong", referenced from:
_$s9InputMask23MaskedTextFieldDelegateC8listenerAA0cdeF8Listener_pSgvg in libInputMask.a(MaskedTextFieldDelegate.o)
_$s9InputMask23MaskedTextFieldDelegateC8listenerAA0cdeF8Listener_pSgvM in libInputMask.a(MaskedTextFieldDelegate.o)
_$s9InputMask22MaskedTextViewDelegateC8listenerAA0cdeF8Listener_pSgvg in libInputMask.a(MaskedTextViewDelegate.o)
_$s9InputMask22MaskedTextViewDelegateC8listenerAA0cdeF8Listener_pSgvM in libInputMask.a(MaskedTextViewDelegate.o)
_$s9InputMask010MaskedTextA8ListenerC8listenerAA02Oncd7ChangedE0_pSgvg in libInputMask.a(MaskedTextInputListener.o)
_$s9InputMask010MaskedTextA8ListenerC8listenerAA02Oncd7ChangedE0_pSgvM in libInputMask.a(MaskedTextInputListener.o)
"_swift_updateClassMetadata2", referenced from:
_$s9InputMask18OptionalValueStateCMr in libInputMask.a(OptionalValueState.o)
"_swift_willThrow", referenced from:
_$s9InputMask8CompilerC22determineInheritedType33_B3F36BB0FA1A2C10D03E581AB8FCA34DLL16forLastCharacterAA10ValueStateC0uF0OSJSg_tKF in libInputMask.a(Compiler.o)
_$s9InputMask8CompilerC26compileWithCustomNotations33_B3F36BB0FA1A2C10D03E581AB8FCA34DLL_6stringAA5StateCSJ_SStKF in libInputMask.a(Compiler.o)
_$s9InputMask8CompilerC24determineCustomStateType33_B3F36BB0FA1A2C10D03E581AB8FCA34DLL12forCharacterAA05ValueF0C0fG0OSJ_tKF in libInputMask.a(Compiler.o)
_$s9InputMask15FormatSanitizerC15checkOpenBraces33_9630C2BFB0C1EEC80D8C490909BFFB6BLLyySSKF in libInputMask.a(FormatSanitizer.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i want to run ios app successfully
Upvotes: 0
Views: 830
Reputation: 121
try this
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf node_modules yarn.lock
cd ios
rm -rf Pods Podfile.lock
cd ..
yarn
cd ios
arch -x86_64 pod install
cd ..
npx react-native run-ios
Upvotes: 2