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

[🐛] [iOS] [Auth] - The app crash on iOS when I login. #7080

Closed
1 of 5 tasks
aureliopetrone opened this issue Apr 27, 2023 · 10 comments · Fixed by #7541
Closed
1 of 5 tasks

[🐛] [iOS] [Auth] - The app crash on iOS when I login. #7080

aureliopetrone opened this issue Apr 27, 2023 · 10 comments · Fixed by #7541
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report Type: Stale Issue has become stale - automatically added by Stale bot

Comments

@aureliopetrone
Copy link

aureliopetrone commented Apr 27, 2023

Issue

The app build successful but once I login I get this error. It was working fine until yesterday so I guess it's something related to the new update. For sure it's something in the AuthModule since if I disable the MFA it works fine.

2023-04-27 10:31:45.333976+0200 MyApp[82893:36653136] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(
	0   CoreFoundation                      0x0000000180437330 __exceptionPreprocess + 172
	1   libobjc.A.dylib                     0x0000000180051274 objc_exception_throw + 56
	2   CoreFoundation                      0x00000001804bd1c8 -[__NSCFString characterAtIndex:].cold.1 + 0
	3   CoreFoundation                      0x00000001804c8f4c -[__NSPlaceholderDictionary initWithCapacity:].cold.1 + 0
	4   CoreFoundation                      0x00000001804a7178 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 252
	5   CoreFoundation                      0x0000000180436070 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 48
	6   MyApp                       0x0000000104bba1e4 -[RNFBAuthModule convertMultiFactorData:] + 764
	7   MyApp                       0x0000000104bb9b7c -[RNFBAuthModule firebaseUserToDict:] + 2560
	8   MyApp                       0x0000000104bb8ffc -[RNFBAuthModule constantsToExport] + 604
	9   MyApp                       0x0000000104dba840 __57-[RCTModuleData gatherConstantsAndSignalJSRequireEnding:]_block_invoke + 44
	10  MyApp                       0x0000000104e21aa8 RCTUnsafeExecuteOnMainQueueSync + 52
	11  MyApp                       0x0000000104dba5fc -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] + 696
	12  MyApp                       0x0000000104dba338 -[RCTModuleData gatherConstants] + 40
	13  MyApp                       0x0000000104d68c34 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke + 192
	14  libdispatch.dylib                   0x000000010c18c528 _dispatch_call_block_and_release + 24
	15  libdispatch.dylib                   0x000000010c18dd50 _dispatch_client_callout + 16
	16  libdispatch.dylib                   0x000000010c19e978 _dispatch_main_queue_drain + 1684
	17  libdispatch.dylib                   0x000000010c19e2d4 _dispatch_main_queue_callback_4CF + 40
	18  CoreFoundation                      0x000000018039a784 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
	19  CoreFoundation                      0x0000000180394de4 __CFRunLoopRun + 1912
	20  CoreFoundation                      0x0000000180394254 CFRunLoopRunSpecific + 584
	21  GraphicsServices                    0x0000000188eb7c9c GSEventRunModal + 160
	22  UIKitCore                           0x000000011ffdeff0 -[UIApplication _run] + 868
	23  UIKitCore                           0x000000011ffe2f3c UIApplicationMain + 124
	24  MyApp                       0x0000000104394bc4 main + 300
	25  dyld                                0x000000010bab5514 start_sim + 20
	26  ???                                 0x000000010bbb1e50 0x0 + 4491779664
	27  ???                                 0x1148000000000000 0x0 + 1245245296967942144
)
libc++abi: terminating due to uncaught exception of type NSException

package.json:

    ...
    @react-native-firebase/app": "^16.4.6",
    "@react-native-firebase/auth": "^16.4.6",
    "@react-native-firebase/database": "^16.4.6",
    "@react-native-firebase/firestore": "^16.4.6",
    "@react-native-firebase/functions": "^16.4.6",
    "@react-native-firebase/messaging": "^16.4.6",
    "@react-native-firebase/storage": "^16.4.6"
    ...
    "react-native": "0.70.6"

Environment

  • iOS
  • Android
  • iOS but have not tested behavior on Android
  • Android but have not tested behavior on iOS
  • Both
  • Latest RN Version cause I've just reinstall it and it stopped working since yesterday
@aureliopetrone aureliopetrone added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Apr 27, 2023
@aureliopetrone aureliopetrone changed the title [🐛] Bug Report Title - CHANGE ME [🐛] [iOS] [Auth] - The app crash on iOS when I login. Apr 27, 2023
@github-actions
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Type: Stale Issue has become stale - automatically added by Stale bot label May 25, 2023
@luketgriffith
Copy link

We have one particular user that is generating this same crash on iOS. It only affects the one device as far as we can tell (iphone 11 pro). We are on versions 16.5 for rn firebase and .68.9 for react native itself. Very odd though since none of other other users run into the issue.

@github-actions github-actions bot removed the Type: Stale Issue has become stale - automatically added by Stale bot label May 25, 2023
@github-actions
Copy link

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

@github-actions github-actions bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Jun 22, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
@vargajacint
Copy link
Contributor

vargajacint commented Dec 27, 2023

Hey @aureliopetrone, Did you find a solution?

It's same in here with react-native: 0.73.1 and @react-native-firebase/auth: 18.7.3 packages.
The build was successful, but the application is crashing on launching phase on iOS 17.2.1 (iPhone 14 Pro). Only one device (1/4) affected right now

This is what I found from TestFlight crash report:
-[RNFBAuthModule convertMultiFactorData:]

Exception reason:

-[RNFBAuthModule convertMultiFactorData:] + 472
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]

Debugging update 1:

I changed the @"factorId" : [self getJSFactorId:(hint.factorID)] implementation to just some dummy string, like @"factorId" : @"1xxxxx" and the application is started to working fine. I continue to debug the getJSFactorId fn

Debugging update 2:

After I finally managed to run the application on the previously mentioned phone, I've noticed that I was logged in(from cache I guess). I've just simply logged out, and then restored the above mentioned code to @"factorId" : [self getJSFactorId:(hint.factorID)]. After that I've built the application again, and woala 🪄 the app is started to working.
Also, I deleted the locally installed application, and installed the application again from TestFlight and it worked as well.

Verdict:

I think the problem occurs If the user was previously logged in, and some cached thing brakes everything. I'm going to check the getJSFactorId implementation, maybe I will find something

@mikehardy
Copy link
Collaborator

@vargajacint solid investigation here thank you very much! Continuing the conversation on your proposed PR now - much appreciated

@BlindDev
Copy link

BlindDev commented Aug 3, 2024

We are experiencing the same issue with 19.3.0

The app crashes on launch.

HW:

Hardware Model:      iPhone14,2
OS Version:          iPhone OS 17.6 (21G80)

package.json:

  "@react-native-firebase/analytics": "^19.3.0",
  "@react-native-firebase/app": "^19.3.0",
  "@react-native-firebase/auth": "^19.3.0",
  "@react-native-firebase/crashlytics": "^19.3.0",
  "@react-native-firebase/dynamic-links": "^19.3.0",
  "@react-native-firebase/in-app-messaging": "^19.3.0",
  "@react-native-firebase/installations": "^19.3.0",
  "@react-native-firebase/messaging": "^19.3.0",
  "@react-native-firebase/remote-config": "^19.3.0",
  
  "react-native": "0.73.5",

Exception backtrace:

Last Exception Backtrace:
0   CoreFoundation                	       0x19dd8cf20 __exceptionPreprocess + 164
1   libobjc.A.dylib               	       0x195c2b2b8 objc_exception_throw + 60
2   CoreFoundation                	       0x19dd1ee6c -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 728
3   CoreFoundation                	       0x19dd1ea88 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 52
4   my.app                      	       0x104b5cf30 -[RNFBAuthModule convertMultiFactorData:] (in my.app) (RNFBAuthModule.m:1710) + 2936624
5   my.app                      	       0x104b5cb28 -[RNFBAuthModule firebaseUserToDict:] (in my.app) (RNFBAuthModule.m:1700) + 2935592
6   my.app                      	       0x104b5c548 -[RNFBAuthModule constantsToExport] (in my.app) (RNFBAuthModule.m:1669) + 2934088
7   my.app                      	       0x104c1dfa0 __57-[RCTModuleData gatherConstantsAndSignalJSRequireEnding:]_block_invoke (in my.app) (RCTModuleData.mm:459) + 3727264
8   my.app                      	       0x104c43f08 RCTUnsafeExecuteOnMainQueueSync (in my.app) (RCTUtils.m:0) + 3882760
9   my.app                      	       0x104c1df14 -[RCTModuleData gatherConstantsAndSignalJSRequireEnding:] (in my.app) (RCTModuleData.mm:0) + 3727124
10  my.app                      	       0x104c06834 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke (in my.app) (RCTCxxBridge.mm:1004) + 3631156
11  libdispatch.dylib             	       0x1a5c3113c _dispatch_call_block_and_release + 32
12  libdispatch.dylib             	       0x1a5c32dd4 _dispatch_client_callout + 20
13  libdispatch.dylib             	       0x1a5c415ec _dispatch_main_queue_drain + 1060
14  libdispatch.dylib             	       0x1a5c411b8 _dispatch_main_queue_callback_4CF + 44
15  CoreFoundation                	       0x19dd5f710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
16  CoreFoundation                	       0x19dd5c914 __CFRunLoopRun + 1996
17  CoreFoundation                	       0x19dd5bcd8 CFRunLoopRunSpecific + 608
18  GraphicsServices              	       0x1e27ad1a8 GSEventRunModal + 164
19  UIKitCore                     	       0x1a0395ae8 -[UIApplication _run] + 888
20  UIKitCore                     	       0x1a0449d98 UIApplicationMain + 340
21  my.app                      	       0x1048984d0 main (in my.app) (main.m:8) + 34000
22  dyld                          	       0x1c1533154 start + 2356

image

Should I open a new issue?

@Juanca0312
Copy link

Juanca0312 commented Aug 5, 2024

Same issue here

HW:
Hardware model: Iphone 12
OS version: iPhone OS 17.5.1

package.json

    "@react-native-firebase/app": "^19.3.0",
    "@react-native-firebase/auth": "^19.3.0",
    "@react-native-firebase/crashlytics": "^19.3.0",
    "@react-native-firebase/firestore": "^19.3.0",
    "@react-native-firebase/messaging": "^19.3.0",
    "@react-native-firebase/storage": "^19.3.0",

    "react-native": "0.73.6",

error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x19c3a8f20 0x194256018 0x19c33ae6c 0x19c33aa88 0x100eaf2e8 0x100eaeee0 0x100eae900 0x100f89fb0 0x100faff18 0x100f89f24 0x100f729d4 0x103d4cb98 0x103d4e7bc 0x103d5eec4 0x103d5e90c 0x19c37b710 0x19c378914 0x19c377cd8 0x1e12281a8 0x19e9b090c 0x19ea649d0 0x1008c0418 0x1bfa29e4c)
libc++abi: terminating due to uncaught exception of type NSException
image

@Lu1815
Copy link

Lu1815 commented Aug 16, 2024

I am having the same issue, is there any solution for this?

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]'
*** First throw call stack:
(0x19c3a8f20 0x194256018 0x19c33ae6c 0x19c33aa88 0x100eaf2e8 0x100eaeee0 0x100eae900 0x100f89fb0 0x100faff18 0x100f89f24 0x100f729d4 0x103d4cb98 0x103d4e7bc 0x103d5eec4 0x103d5e90c 0x19c37b710 0x19c378914 0x19c377cd8 0x1e12281a8 0x19e9b090c 0x19ea649d0 0x1008c0418 0x1bfa29e4c)
libc++abi: terminating due to uncaught exception of type NSException

@romanakash
Copy link

romanakash commented Jan 25, 2025

Also similar issue here

 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[10]'
*** First throw call stack:

@mikehardy
Copy link
Collaborator

Original issue logged against v16. Then reports against v19. We're on v21.x.x now - so the original issue is no longer really representative. Please log a new issue with full details

@invertase invertase locked and limited conversation to collaborators Jan 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report Type: Stale Issue has become stale - automatically added by Stale bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants