I am trying to create a release version of my app for iOS using Expo. The app works perfectly on Android (both simulator and physical device) and on the iOS simulator. However, when I run the app in release mode in XCode and test it on a real iPhone, I encounter the following error upon startup:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'*** First throw call stack:(0x19abb4f20 0x192a62018 0x19ab46e6c 0x19ab46a88 0x100697d58 0x1006962ec 0x1006968a4 0x100696454 0x103508b98 0x10350a7bc 0x10351ad58 0x10351a90c 0x19ab87710 0x19ab84914 0x19ab83cd8 0x1dfa341a8 0x19d1bc90c 0x19d2709d0 0x1000a4418 0x1be235e4c)libc++abi: terminating due to uncaught exception of type NSException
Details:
- Backend: Firebase using
react-native-firebase
package - Modules in use:
"@react-native-firebase/app": "^19.1.1"
"@react-native-firebase/auth": "^19.1.1"
"@react-native-firebase/crashlytics": "^19.1.1"
"@react-native-firebase/firestore": "^19.1.1"
"@react-native-firebase/messaging": "^19.1.1"
"@react-native-firebase/storage": "^19.1.1"
- Build Command: npx expo prebuild --platform ios
I have verified my Firebase project settings and ensured that the GoogleServices-Info.plist file matches the bundle ID registered in AppStoreConnect.
Expected Behavior:I expect the app to run without errors in release mode on a physical iPhone.
Problem:The error message logged in XCode is not meaningful enough to diagnose the issue. I am looking for guidance on how to resolve this error or for someone who has encountered this problem before to provide insight.
Repository for Testing:I have created a test repository to replicate the issue: https://github.com/Lu1815/expo-test-app-for-stackoverflow
Any help or suggestions would be greatly appreciated. Thank you!