Firebase email link authentication crashing our Flutter app on iOS - ios

We are using authentication by email link in our Flutter app with firebase_auth package, and we are seeing crashes on iOS devices with
Fatal Exception: NSInvalidArgumentException
The link provided is not valid for email/link sign-in. Please check the link by calling isSignInWithEmailLink:link: on Auth before attempting to use it for email/link sign-in.
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x18f2095f0 __exceptionPreprocess
1 libobjc.A.dylib 0x18ef2bbcc objc_exception_throw
2 CoreFoundation 0x18f0ffb28 -[NSCache init]
3 Runner 0x102fde5ec +[FIRAuthExceptionUtils raiseInvalidParameterExceptionWithReason:] + 30 (FIRAuthExceptionUtils.m:30)
4 Runner 0x102fcf970 -[FIRAuth internalSignInAndRetrieveDataWithEmail:link:callback:] + 729 (FIRAuth.m:729)
5 Runner 0x102fd0028 -[FIRAuth internalSignInAndRetrieveDataWithCredential:isReauthentication:callback:] + 770 (FIRAuth.m:770)
6 Runner 0x102fcef5c __43-[FIRAuth signInWithEmail:link:completion:]_block_invoke + 562 (FIRAuth.m:562)
7 libdispatch.dylib 0x18eece9a8 _dispatch_call_block_and_release
8 libdispatch.dylib 0x18eecf524 _dispatch_client_callout
9 libdispatch.dylib 0x18eeacb3c _dispatch_lane_serial_drain$VARIANT$armv81
10 libdispatch.dylib 0x18eead54c _dispatch_lane_invoke$VARIANT$armv81
11 libdispatch.dylib 0x18eeb684c _dispatch_workloop_worker_thread
12 libsystem_pthread.dylib 0x18ef20b74 _pthread_wqthread
13 libsystem_pthread.dylib 0x18ef23740 start_wqthread
We added some logging for investigation and saw that invalid link was
com.xxxx.xxxx://google/link/?request_ip_version=IP%5FV6&match_message=No%20pre%2Dinstall%20link%20matched%20for%20this%20device%2E
It seems that it doesn't affect 100% of users who are trying to log in with an email link and we were not able to reproduce it on our devices even once. What could produce a link like that?There doesn't seem to be any documentation that would mention this error message

Related

iOS React Native app runs perfectly in testing but crashes in release build

I wrote a simple app with React Native targeting iOS. When I build the app in Xcode to test on simulators or my iPhone everything works perfectly. When I archive the build in Xcode and load it on my iPhone using the development option, it crashes when I press the only button on screen on start.
The app source code can be found on GitHub.
I am using React Native ~0.63.4 and React: 16.13.1 in a bare Expo workflow.
Third party dependencies:
#react-native-async-storage/async-storage
expo-constants
expo-notifications
uuid
react-native-date-picker
Here is a full crash report from the device logs: Google Drive
I'm at a loss trying to interpret the crash logs but the thread that crashes is exactly this everytime (except for the thread number):
Thread 3 name: Dispatch queue: com.facebook.react.ExceptionsManagerQueue
Thread 3 Crashed:
0 libsystem_kernel.dylib 0x00000001d285f414 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001eed77b40 pthread_kill + 272
2 libsystem_c.dylib 0x00000001aec84b74 abort + 104
3 libc++abi.dylib 0x00000001b9fbccf8 __cxxabiv1::__aligned_malloc_with_fallback+ 81144 (unsigned long) + 0
4 libc++abi.dylib 0x00000001b9fade4c demangling_unexpected_handler+ 20044 () + 0
5 libobjc.A.dylib 0x00000001b9eb6f64 _objc_terminate+ 28516 () + 144
6 libc++abi.dylib 0x00000001b9fbc0e0 std::__terminate(void (*)+ 78048 ()) + 20
7 libc++abi.dylib 0x00000001b9fbc06c std::terminate+ 77932 () + 44
8 libdispatch.dylib 0x00000001a5554dc4 _dispatch_client_callout + 40
9 libdispatch.dylib 0x00000001a555c10c _dispatch_lane_serial_drain + 580
10 libdispatch.dylib 0x00000001a555cc5c _dispatch_lane_invoke + 408
11 libdispatch.dylib 0x00000001a5566d78 _dispatch_workloop_worker_thread + 708
12 libsystem_pthread.dylib 0x00000001eed78804 _pthread_wqthread + 276
13 libsystem_pthread.dylib 0x00000001eed7f75c start_wqthread + 8
When I open the app while connected to my laptop and have the console for my iPhone open while crashing the app, I first get these messages under Errors and Faults:
error 16:14:06.383233-0500 remindrs Error: Requiring unknown module "undefined".
error 16:14:06.386759-0500 remindrs Unhandled JS Exception: Error: Requiring unknown module "undefined".
error 16:14:06.463315-0500 SpringBoard Ignoring state for untracked process [application<org.name.remindrs>:5966]: <RBSProcessState| task:none debug:none>
fault 16:14:06.559231-0500 SpringBoard Unable to move topic <private>, This topic was not in the list provided! APSTopicListOpportunistic
I've tried cleaning the build folder, turning off Swift compiler optimizations, and rearchived the project multiple times.
None of my searching has paid off and I'm not sure how to identify the issue I am having. I don't know if it is with React Native or with some configuration in Xcode.
Thank you for your help!
I solved the problem by removing a few lines of codes dealing with a Date. I'm not sure why this caused a crash in release and not debug but the problem is fixed!

Spurious app crashes after making a web request on iOS 11 with Alamofire

We've had a few very bizarre crashes in our app recently. They are not reliably reproducable. The crashes have all occurred on iOS 11 devices so far. Our app is written in Swift 3.2. We are using Xcode 9.0.1 with the standard build system (not the new Swift build system). It seems that after performing a certain web request, the app crashes with the below stack trace:
Crashed: com.apple.main-thread
0 OurFramework 0x105283e84 __swift_deallocate_boxed_opaque_existential_0 + 2588
1 OurFramework 0x10528366c __swift_deallocate_boxed_opaque_existential_0 + 516
2 OurFramework 0x10528b368 swift_rt_swift_storeEnumTagSinglePayload + 24748
3 OurFramework 0x1052911cc swift_rt_swift_storeEnumTagSinglePayload + 48912
4 OurFramework 0x1052133d8 __swift_memmove_array32_8 + 1336
5 OurFramework 0x10521304c __swift_memmove_array32_8 + 428
6 OurFramework 0x105292504 swift_rt_swift_storeEnumTagSinglePayload + 53832
7 Alamofire 0x1057cac64 _T09Alamofire11DataRequestC8responseACXDSo13DispatchQueueCSg5queue_x0D10SerializeryAA0B8ResponseVy16SerializedObjectQzGc17completionHandlertAA0biH8ProtocolRzlFyycfU_yycfU_AA0biH0VyypG_Tg5 + 264
8 Alamofire 0x1057ca3f8 _T0Ix_IyB_TR + 36
9 libdispatch.dylib 0x1860c5088 _dispatch_call_block_and_release + 24
10 libdispatch.dylib 0x1860c5048 _dispatch_client_callout + 16
11 libdispatch.dylib 0x1860d1b74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
12 CoreFoundation 0x1866e9eb0 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13 CoreFoundation 0x1866e7a8c __CFRunLoopRun + 2012
14 CoreFoundation 0x186607fb8 CFRunLoopRunSpecific + 436
15 GraphicsServices 0x18849ff84 GSEventRunModal + 100
16 UIKit 0x18fbdc2e8 UIApplicationMain + 208
17 OurApp 0x104de98b0 main (main.swift:19)
18 libdyld.dylib 0x18612a56c start + 4
We are using Crashlytics to track our crashes and I'm not sure if it's because of a symbolication issue that I don't see more info than this but the trace indicates that something is going awry during a web request. Our app uses Alamofire to make web requests. Results from our testing where this crash occurred also support this theory since the crashes always occurred right after the app made a request to our backend. Could it be that in iOS 11 something changed in the underlying NSURLSession that Alamofire uses? Maybe iOS 11 is using a different caching strategy or something that's causing alamofire to invoke our result completion handler in a way that causes this crash? Has anyone seen this kind of crash before? What do __swift_deallocate_boxed_opaque_existential and swift_rt_swift_storeEnumTagSinglePayload mean? Any help is greatly appreciated, thank you!

FMDB Crash: SEGV_MAPERR at [FMDatabaseQueue inDatabase:]

I'm using FMDB in an iOS app. Recently I have received several crash reports from Apteligent about a crash of FMDB:
0 libdispatch.dylib 0x00000001810ab120 _dispatch_main_queue_callback_4CF + 2904
! 1 myApp 0x00000001001ac840 -[FMDatabaseQueue inDatabase:] (FMDatabaseQueue.m:142)
2 myApp 0x000000010011844c +[DataBaseController insert:withObjects:] (DataBaseController.m:602)
3 myApp 0x0000000100118254 +[DataBaseController insertObjects:withObjects:] (DataBaseController.m:575)
4 myApp 0x0000000100150e80 -[SendManagementBBDD crearySalvarEnvioConSolicitud:EntidadParaEncolar:borrarTrasEnvio:] (SendManagementBBDD.m:686)
5 myApp 0x0000000100150a28 __76-[SendManagementBBDD sendEntitiesAfterDetail:OnComplete:]_block_invoke (SendManagementBBDD.m:615)
6 libdispatch.dylib 0x00000001810a55f0 _dispatch_client_callout + 12
7 libdispatch.dylib 0x00000001810b0b94 _dispatch_sync_f_invoke + 68
8 myApp 0x0000000100150404 -[SendManagementBBDD sendEntitiesAfterDetail:OnComplete:] (SendManagementBBDD.m:563)
9 myApp 0x000000010005c284 __44-[DetailVC startWork:]_block_invoke (DetailVC.m:286)
10 libdispatch.dylib 0x00000001810a5630 _dispatch_call_block_and_release + 20
11 libdispatch.dylib 0x00000001810a55f0 _dispatch_client_callout + 12
12 libdispatch.dylib 0x00000001810b3a88 _dispatch_root_queue_drain + 2136
13 libdispatch.dylib 0x00000001810b3224 _dispatch_worker_thread3 + 108
14 libsystem_pthread.dylib 0x00000001812b9470 _pthread_wqthread + 1088
15 libsystem_pthread.dylib 0x00000001812b9020 start_wqthread + 0
I access to the database from multiple threads. As the documentation says, I have a single instance of FMDatabaseQueue and I share it across all the threads of the app. I'm getting a SEGV_MAPERR crash at the method [FMDatabaseQueue inDatabase:]
This crash happens hardly ever, but I would like to resolve it.
Any ideas what is causing it?
Thank you very much.
Like your other question, this crash seems to be a part of your app code and not Crittercism SDK. If you still believe that this has been caused due to Crittercism, you can create a support ticket by sending an email to support#apteligent.com by mentioning the concerned App ID and the direct crash URL. Be noted that the email support is available for paid customers only.

com.apple.NSURLSession-work EXC_BAD_ACCESS Crash debugging

I'm seeing the following crash report, but it's not reproducible. How would I go about debugging it? Is this an AFNetworking issue? I'm using version 2.4.1.
Crashed: com.apple.NSURLSession-work
EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0x0000000000000000
Thread : Crashed: com.apple.NSURLSession-work
0 CoreFoundation 0x0000000184aad978 CFDictionaryGetValue + 56
1 Foundation 0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
2 Foundation 0x0000000185aa9300 _NSSetLongLongValueAndNotify + 72
3 CFNetwork 0x0000000184543468 -[__NSCFLocalSessionTask _task_onqueue_didFinish] + 472
4 CFNetwork 0x0000000184544b38 -[__NSCFLocalSessionTask connection:didFinishLoadingWithError:] + 40
5 CFNetwork 0x000000018458d030 __46-[__NSCFURLSessionConnection _task_sendFinish]_block_invoke + 136
6 libdispatch.dylib 0x0000000196a49994 _dispatch_call_block_and_release + 24
7 libdispatch.dylib 0x0000000196a49954 _dispatch_client_callout + 16
8 libdispatch.dylib 0x0000000196a540a4 _dispatch_queue_drain + 1448
9 libdispatch.dylib 0x0000000196a4ca5c _dispatch_queue_invoke + 132
10 libdispatch.dylib 0x0000000196a56318 _dispatch_root_queue_drain + 720
11 libdispatch.dylib 0x0000000196a57c4c _dispatch_worker_thread3 + 108
12 libsystem_pthread.dylib 0x0000000196c2922c _pthread_wqthread + 816
Yes, it's probably an AFNetworking bug (fixed in 2.5.0), in all likelihood. Specifically, this one:
https://github.com/AFNetworking/AFNetworking/issues/1477
If not, then it is probably something similar—a key-value observer trying to observe some aspect of a URL session task has been deallocated and didn't stop observing that task prior to being deallocated.
I got the same issue and I found it is because I was using Firebase SDK and I upgraded it to 7.0.0,(Although this issue is reported by many developers from > 6.32.1 to 7.0.0) So the firebasePerformance is causing this issue in the first place, which later caused a crash while downloading images using SDWebImage. More information about this issue is here:
firebase/firebase-ios-sdk#6734
Firebase recently fixed this and released a new version for FirebasePerformance (7.0.1) After upgrading to version 7.0.1, I wasn't able to reproduce the crash any longer.
So upgrading of FirebasePerformance SDK to 7.0.1 version worked for me.

+[UIPasteboard _accessibilityUseQuickSpeakPasteBoard]: unrecognized selector sent to class

I asked this question on Apple Dev forum, but still didn't get an answer.
We expirience 100% iOS 8 devices crash:
+[UIPasteboard _accessibilityUseQuickSpeakPasteBoard]: unrecognized selector sent to class
The stack trace is:
Thread : Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x2889ec1f __exceptionPreprocess + 126
1 libobjc.A.dylib 0x36049c8b objc_exception_throw + 38
2 CoreFoundation 0x288a3f55 __CFExceptionProem
3 CoreFoundation 0x288a1def ___forwarding___ + 354
4 CoreFoundation 0x287d3df8 _CF_forwarding_prep_0 + 24
5 UIAccessibility 0x331fc157 +[UIPasteboard_QSExtras pasteboardWithName:create:] + 30
6 MyApp 0x002eb507 -[TJEventOptimizer .cxx_destruct]
7 MyApp 0x002eb28b -[TJEventOptimizer .cxx_destruct]
8 MyApp 0x002f0c2b -[TJEventOptimizer .cxx_destruct]
9 MyApp 0x002eeedb -[TJEventOptimizer .cxx_destruct]
10 Foundation 0x295adb5b __NSThread__main__ + 1118
11 libsystem_pthread.dylib 0x3670ce93 _pthread_body + 138
12 libsystem_pthread.dylib 0x3670ce07 _pthread_start + 118
13 libsystem_pthread.dylib 0x3670ab90 thread_start + 8
Despite the fact, TapJoy is captured in the stack trace, their FAQ says it is ocaisonally wrong and has nothing to do with TapJoy's code, but rather iOS 8 bug.
Is it correct?
What accessibility setting related to the crash?
This problem appears because TapJoy has used categories in static library (that's UIPasteboard_QSExtras)
The solution is super simple, you need to notify linker about that
1) Click on the project
2) Click on the target
3) Open Build Settings tab
4) Search for Other Linker Flags
5) Double click on Other Linker Flags
6) Add -ObjC and -all_load flags
7)
Remove binary (delete from device/simulator),
Clean project (hitting cmd+shift+k) and
build again (hitting cmd+b).
You're ready to go!
the solution suggested by I0gg3r unfortunately does not work.. I tested this on 3 apps, and still find the UIPasteboard crash as most frequent crash.. Any other suggestions? Is there a way to disable the accessibility settings in the app?
Update: Tapjoy has released an update (10.2.1) which solves this issue. Please download their latest SDK

Resources