Running react-native iOS app fails due to RealmJS framwork

I am creating a react-native app where I am using MongoDB with Realm.
When I run in Android. it works properly but in iOS I am having some issues with RealmJS.

I have tried deleting and reinstalling node_modules, and also I have deleted pods and reinstalled but it didn’t solve the issue.

This is what happens when trying to run iOS app:

Ld /Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RealmJS/RealmJS.framework/RealmJS normal (in target ‘RealmJS’ from project ‘Pods’)
cd /Users/user/Desktop/petsquare/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-ios11.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.2.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RealmJS -L/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/RealmJS -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RealmJS -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RCT-Folly -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RCTTypeSafety -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-Codegen -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-Core -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-NativeModulesApple -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTBlob -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTLinking -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTNetwork -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTSettings -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTText -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-RCTVibration -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-debug -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-hermes -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-logger -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-perflogger -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/React-utils -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/ReactCommon -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/SocketRocket -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/Yoga -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/fmt -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/glog -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/libevent -F/Users/user/Desktop/petsquare/ios/Pods/../../node_modules/realm/react-native/ios -F/Users/user/Desktop/petsquare/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -filelist /Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmJS.build/Objects-normal/x86_64/RealmJS.LinkFileList -install_name @rpath/RealmJS.framework/RealmJS -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmJS.build/Objects-normal/x86_64/RealmJS_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -lc++ -lcompression -lrealm-js-ios -lz -framework React -framework Foundation -framework React -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RealmJS.build/Objects-normal/x86_64/RealmJS_dependency_info.dat -o /Users/user/Library/Developer/Xcode/DerivedData/MyApp-ejiysjmdywzzteaetozpazepiqjs/Build/Products/Debug-iphonesimulator/RealmJS/RealmJS.framework/RealmJS

I am using:

realm: 12.2.1
react-native: 0.72
@realm/react: 0.6.0
node: 15.8.0
npm: 9.6.2
Xcode: 13.2.1

  • Including the crash log in the question is somewhat helpful but including the code that causes the crash would be even more helpful. Add a breakpoint early in your code and step through it line by line until it crashes and then include that code in the question (indicating which line caused the crash). It would also help to include a snippet from your actual podfile. It also appears you’re using a old versions of Realm, node, npm and XCode – is that intentional? What version of CocoaPods do you have (pod –version)?

    – 

Leave a Comment