After updating from 5.16.0 to 5.17.0 we noticed a new crash on Fabric:
Task created in a session that has been invalidated
-[FIRInstanceIDCheckinService checkinWithExistingCheckin:completion:]
Fatal Exception: NSGenericException
0 CoreFoundation 0x1d882dea4 __exceptionPreprocess
1 libobjc.A.dylib 0x1d79fda50 objc_exception_throw
2 CFNetwork 0x1d8dddf38 -[__NSCFURLLocalSessionConnection _tick_initialize]
3 Kleinanzeigen 0x1003f2940 -[FIRInstanceIDCheckinService checkinWithExistingCheckin:completion:]
4 Kleinanzeigen 0x1003f0010 -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:]
5 Kleinanzeigen 0x1003efc28 -[FIRInstanceIDAuthService performScheduledCheckin]
6 Foundation 0x1d92e2488 __NSFireTimer
7 CoreFoundation 0x1d87be718 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
8 CoreFoundation 0x1d87be448 __CFRunLoopDoTimer
9 CoreFoundation 0x1d87bdc7c __CFRunLoopDoTimers
10 CoreFoundation 0x1d87b8b58 __CFRunLoopRun
11 CoreFoundation 0x1d87b80e0 CFRunLoopRunSpecific
12 GraphicsServices 0x1daa31584 GSEventRunModal
13 UIKitCore 0x205b18c00 UIApplicationMain
14 Kleinanzeigen 0x1000dc750 main (AppDelegate.swift:11)
15 libdyld.dylib 0x1d8276bb4 start
Unfortunately we don't know how to reproduce it.
I found a few problems with this issue:
@chliangGoogle
Looks like this function is being called:
https://github.com/firebase/firebase-ios-sdk/blob/9848883d698380ff0ce62fd58e0880b26ff50ac6/Firebase/InstanceID/FIRInstanceIDCheckinService.m#L71
after stopFetching was called, which invalidates the session:
https://github.com/firebase/firebase-ios-sdk/blob/9848883d698380ff0ce62fd58e0880b26ff50ac6/Firebase/InstanceID/FIRInstanceIDCheckinService.m#L174
At the very least we should check if the session is still valid and gracefully handle the callback.
Firebase 5.17.0 has an IID version that might not be compatible with other SDKs and we already knew checkin was corrupted in that version. I would suggest to try again with the latest 5.18.0 and see if it still happens to you.
Looks like the fix didn't make it to 5.18.0. The new fix will be out today. Please look out the status the same as https://github.com/firebase/firebase-ios-sdk/issues/2438 here.
Please try again and update your pod with IID 3.7.0.
In order to successfully pod update to FirebaseInstanceID 3.7.0, you may need to run pod deintegrate or rm -rf Pods first.
Thank you for the hints. In case somebody else looks into this thread, here's what worked for us (updating FirebaseInstanceID, can't tell yet if the crash is fixed, new App Store release still outstanding):
$ pod update FirebaseInstanceID
Installing FirebaseInstanceID 3.7.0 (was 3.6.0)
Still seeing the crash on our latest App Store release that went live today:
Fatal Exception: NSGenericException
0 CoreFoundation 0x1c0729ea4 __exceptionPreprocess
1 libobjc.A.dylib 0x1bf8f9a50 objc_exception_throw
2 CFNetwork 0x1c0cd9f38 -[__NSCFURLLocalSessionConnection _tick_initialize]
3 Kleinanzeigen 0x104d73170 -[FIRInstanceIDCheckinService checkinWithExistingCheckin:completion:] (FIRInstanceIDCheckinService.m:170)
4 Kleinanzeigen 0x104d70840 -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:] (FIRInstanceIDAuthService.m:188)
5 Kleinanzeigen 0x104d703fc -[FIRInstanceIDAuthService performScheduledCheckin] (FIRInstanceIDAuthService.m:150)
6 Foundation 0x1c11de488 __NSFireTimer
7 CoreFoundation 0x1c06ba718 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
8 CoreFoundation 0x1c06ba448 __CFRunLoopDoTimer
9 CoreFoundation 0x1c06b9c7c __CFRunLoopDoTimers
10 CoreFoundation 0x1c06b4b58 __CFRunLoopRun
11 CoreFoundation 0x1c06b40e0 CFRunLoopRunSpecific
12 GraphicsServices 0x1c292d584 GSEventRunModal
13 UIKitCore 0x1eda14c00 UIApplicationMain
14 Kleinanzeigen 0x104a2a98c main (AppDelegate.swift:11)
15 libdyld.dylib 0x1c0172bb4 start
$ grep -i fire Podfile.lock
- Firebase/Core (5.18.0):
- Firebase/CoreOnly
- FirebaseAnalytics (= 5.7.0)
- Firebase/CoreOnly (5.18.0):
- FirebaseCore (= 5.3.1)
- Firebase/Messaging (5.18.0):
- Firebase/CoreOnly
- FirebaseMessaging (= 3.3.2)
- Firebase/RemoteConfig (5.18.0):
- Firebase/Core
- FirebaseRemoteConfig (= 3.1.0)
- FirebaseABTesting (2.0.0):
- FirebaseCore (~> 5.0)
- FirebaseAnalytics (5.7.0):
- FirebaseCore (~> 5.3)
- FirebaseInstanceID (~> 3.6)
- FirebaseAnalyticsInterop (1.2.0)
- FirebaseCore (5.3.1):
- FirebaseInstanceID (3.7.0):
- FirebaseCore (~> 5.2)
- FirebaseMessaging (3.3.2):
- FirebaseAnalyticsInterop (~> 1.1)
- FirebaseCore (~> 5.2)
- FirebaseInstanceID (~> 3.6)
- FirebaseRemoteConfig (3.1.0):
- FirebaseABTesting (~> 2.0)
- FirebaseAnalytics (~> 5.3)
- FirebaseCore (~> 5.1)
- FirebaseInstanceID (~> 3.3)
- Firebase/Core
- Firebase/Messaging
- Firebase/RemoteConfig
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
- FirebaseAnalyticsInterop
- FirebaseCore
- FirebaseInstanceID
- FirebaseMessaging
- FirebaseRemoteConfig
Firebase: 02f3281965c075426141a0ce1277e9de6649cab9
FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e
FirebaseAnalytics: 23851fe602c872130a2c5c55040b302120346cc2
FirebaseAnalyticsInterop: efbe45c8385ec626e29f9525e5ebd38520dfb6c1
FirebaseCore: 52f851b30e11360f1e67cf04b1edfebf0a47a2d3
FirebaseInstanceID: bd6fc5a258884e206fd5c474ebe4f5b00e21770e
FirebaseMessaging: d740150547f7686b33799f6489f5b69a4706631b
FirebaseRemoteConfig: 7e11c65f0769c09bff6947997c209515058c5318
Is there any progress with this? Tried fixing it by updating to FirebaseInstanceID 3.7.0 and Firebase 5.18.0 and nothing has changed.
@andreiNutmeg I looks like this is the same issue as #2534. The fix is implemented and should be available in the next release.
Hey @maksymmalyhin, thanks for reply. Do you have any rough estimations when it will be released?
@andreiNutmeg It was released yesterday. Feel free to update to FirebaseInstanceID 3.8.0, Firebase 5.19.0
That's great, thanks