firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.59k stars 1.46k forks source link

FIRInstanceID is crashing after updating to 5.17.0 / 5.18.0 #2534

Closed tfonfara closed 5 years ago

tfonfara commented 5 years ago

Environment

Describe the problem

Steps to reproduce:

I'm not able to reproduce it myself but getting a lot of Crashlytics logs. After updating from version 5.15.0 to 5.17.0 (I skipped 5.16.0 so it might affect this version as well) I'm receiving a large number of crashes from FIRInstanceID. Updating to latest 5.18.0 didn't solve this issue, I'm still receiving those crashes.

Crash report:

Fatal Exception: NSGenericException
Task created in a session that has been invalidated

0  CoreFoundation                 0x21e2a1ea4 __exceptionPreprocess
1  libobjc.A.dylib                0x21d471a50 objc_exception_throw
2  CFNetwork                      0x21e851f38 -[__NSCFURLLocalSessionConnection _tick_initialize]
3  AppName                        0x1027b3b00 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke
4  AppName                        0x1027b3b00 __InstrumentDataTaskWithRequestCompletionHandler_block_invoke
5  AppName                        0x102768a28 -[FIRInstanceIDCheckinService checkinWithExistingCheckin:completion:]
6  AppName                        0x1027660f8 -[FIRInstanceIDAuthService fetchCheckinInfoWithHandler:]
7  AppName                        0x102765d10 -[FIRInstanceIDAuthService performScheduledCheckin]
8  Foundation                     0x21ed56488 __NSFireTimer
9  CoreFoundation                 0x21e232718 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
10 CoreFoundation                 0x21e232448 __CFRunLoopDoTimer
11 CoreFoundation                 0x21e231c7c __CFRunLoopDoTimers
12 CoreFoundation                 0x21e22cb58 __CFRunLoopRun
13 CoreFoundation                 0x21e22c0e0 CFRunLoopRunSpecific
14 GraphicsServices               0x2204a5584 GSEventRunModal
15 UIKitCore                      0x24b5c0c00 UIApplicationMain
16 AppName                        0x10256dca0 main
17 libdyld.dylib                  0x21dceabb4 start
paulb777 commented 5 years ago

Thanks for the report. Please confirm that you have version 3.7.0 of the FirebaseInstanceID pod.

tfonfara commented 5 years ago

Latest version of my app that is live in the store was shipped with 5.6.0.

anderscheow commented 5 years ago

I'm getting this problem on live app with version 3.7.0 of the FirebaseInstanceID pod

TheHmmka commented 5 years ago

The same here...

maksymmalyhin commented 5 years ago

@tfonfara Thank you for reporting the issue.

I would like to ask a couple questions that will help to narrow down the search area for the issue:

  1. Are you using FIRInstanceID directly in your app. If yes, would you be able to provide a code snippet illustrating the way you use it
  2. Would you share your Podfile.lock please
tfonfara commented 5 years ago

Sure, hope we can sort this out 😊

  1. No I don't use it directly, the only thing I do is to call FirebaseApp.configure()
  2. See below.
> PODS: > - AEXML (4.3.3) > - Alamofire (4.8.1) > - Bolts-Swift (1.4.0) > - Charts (3.2.2): > - Charts/Core (= 3.2.2) > - Charts/Core (3.2.2) > - CocoaLumberjack/Core (3.5.1) > - CocoaLumberjack/Swift (3.5.1): > - CocoaLumberjack/Core > - Crashlytics (3.12.0): > - Fabric (~> 1.9.0) > - Fabric (1.9.0) > - Firebase/Core (5.18.0): > - Firebase/CoreOnly > - FirebaseAnalytics (= 5.7.0) > - Firebase/CoreOnly (5.18.0): > - FirebaseCore (= 5.3.1) > - Firebase/InAppMessaging (5.18.0): > - Firebase/CoreOnly > - FirebaseInAppMessaging (= 0.13.0) > - Firebase/Messaging (5.18.0): > - Firebase/CoreOnly > - FirebaseMessaging (= 3.3.2) > - Firebase/Performance (5.18.0): > - Firebase/Core > - FirebasePerformance (= 2.2.3) > - Firebase/Storage (5.18.0): > - Firebase/CoreOnly > - FirebaseStorage (= 3.1.0) > - FirebaseABTesting (2.0.0): > - FirebaseCore (~> 5.0) > - Protobuf (~> 3.5) > - FirebaseAnalytics (5.7.0): > - FirebaseCore (~> 5.3) > - FirebaseInstanceID (~> 3.6) > - GoogleAppMeasurement (= 5.7.0) > - GoogleUtilities/AppDelegateSwizzler (~> 5.2) > - GoogleUtilities/MethodSwizzler (~> 5.2) > - GoogleUtilities/Network (~> 5.2) > - "GoogleUtilities/NSData+zlib (~> 5.2)" > - nanopb (~> 0.3) > - FirebaseAnalyticsInterop (1.2.0) > - FirebaseAuthInterop (1.0.0) > - FirebaseCore (5.3.1): > - GoogleUtilities/Logger (~> 5.2) > - FirebaseInAppMessaging (0.13.0): > - FirebaseAnalytics > - FirebaseAnalyticsInterop > - FirebaseCore > - FirebaseInstanceID > - FirebaseInstanceID (3.6.0): > - FirebaseCore (~> 5.3) > - GoogleUtilities/Environment (~> 5.3) > - GoogleUtilities/UserDefaults (~> 5.3) > - FirebaseMessaging (3.3.2): > - FirebaseAnalyticsInterop (~> 1.1) > - FirebaseCore (~> 5.2) > - FirebaseInstanceID (~> 3.6) > - GoogleUtilities/Environment (~> 5.3) > - GoogleUtilities/Reachability (~> 5.3) > - GoogleUtilities/UserDefaults (~> 5.3) > - Protobuf (~> 3.1) > - FirebasePerformance (2.2.3): > - FirebaseAnalytics (~> 5.6) > - FirebaseInstanceID (~> 3.5) > - FirebaseRemoteConfig (~> 3.1) > - GoogleToolboxForMac/Logger (~> 2.1) > - "GoogleToolboxForMac/NSData+zlib (~> 2.1)" > - GoogleUtilities/ISASwizzler (~> 5.2) > - GoogleUtilities/MethodSwizzler (~> 5.2) > - GTMSessionFetcher/Core (~> 1.1) > - Protobuf (~> 3.5) > - FirebaseRemoteConfig (3.1.0): > - FirebaseABTesting (~> 2.0) > - FirebaseAnalytics (~> 5.3) > - FirebaseCore (~> 5.1) > - FirebaseInstanceID (~> 3.3) > - GoogleUtilities/Environment (~> 5.2) > - "GoogleUtilities/NSData+zlib (~> 5.2)" > - Protobuf (~> 3.5) > - FirebaseStorage (3.1.0): > - FirebaseAuthInterop (~> 1.0) > - FirebaseCore (~> 5.2) > - GTMSessionFetcher/Core (~> 1.1) > - FontAwesome.swift (1.3.2) > - GoogleAppMeasurement (5.7.0): > - GoogleUtilities/AppDelegateSwizzler (~> 5.2) > - GoogleUtilities/MethodSwizzler (~> 5.2) > - GoogleUtilities/Network (~> 5.2) > - "GoogleUtilities/NSData+zlib (~> 5.2)" > - nanopb (~> 0.3) > - GoogleToolboxForMac/Defines (2.2.0) > - GoogleToolboxForMac/Logger (2.2.0): > - GoogleToolboxForMac/Defines (= 2.2.0) > - "GoogleToolboxForMac/NSData+zlib (2.2.0)": > - GoogleToolboxForMac/Defines (= 2.2.0) > - GoogleUtilities/AppDelegateSwizzler (5.3.7): > - GoogleUtilities/Environment > - GoogleUtilities/Logger > - GoogleUtilities/Network > - GoogleUtilities/Environment (5.3.7) > - GoogleUtilities/ISASwizzler (5.3.7) > - GoogleUtilities/Logger (5.3.7): > - GoogleUtilities/Environment > - GoogleUtilities/MethodSwizzler (5.3.7): > - GoogleUtilities/Logger > - GoogleUtilities/Network (5.3.7): > - GoogleUtilities/Logger > - "GoogleUtilities/NSData+zlib" > - GoogleUtilities/Reachability > - "GoogleUtilities/NSData+zlib (5.3.7)" > - GoogleUtilities/Reachability (5.3.7): > - GoogleUtilities/Logger > - GoogleUtilities/UserDefaults (5.3.7): > - GoogleUtilities/Logger > - GTMSessionFetcher/Core (1.2.1) > - HockeySDK (5.1.4): > - HockeySDK/DefaultLib (= 5.1.4) > - HockeySDK/DefaultLib (5.1.4) > - Kingfisher (5.2.0) > - lottie-ios (2.5.2) > - nanopb (0.3.901): > - nanopb/decode (= 0.3.901) > - nanopb/encode (= 0.3.901) > - nanopb/decode (0.3.901) > - nanopb/encode (0.3.901) > - OHHTTPStubs/Core (6.1.0) > - OHHTTPStubs/Default (6.1.0): > - OHHTTPStubs/Core > - OHHTTPStubs/JSON > - OHHTTPStubs/NSURLSession > - OHHTTPStubs/OHPathHelpers > - OHHTTPStubs/JSON (6.1.0): > - OHHTTPStubs/Core > - OHHTTPStubs/NSURLSession (6.1.0): > - OHHTTPStubs/Core > - OHHTTPStubs/OHPathHelpers (6.1.0) > - OHHTTPStubs/Swift (6.1.0): > - OHHTTPStubs/Default > - ParallaxView (2.0.8) > - Protobuf (3.7.0) > - SimulatorStatusMagic (2.4.1) > - SRCountdownTimer (1.1) > - SwiftLint (0.31.0) > > DEPENDENCIES: > - AEXML (~> 4.3) > - Alamofire (~> 4.5) > - Bolts-Swift (~> 1.2) > - Charts (~> 3.0) > - CocoaLumberjack/Swift (~> 3.4) > - Crashlytics (~> 3.7) > - Fabric (~> 1.6) > - Firebase/Core > - Firebase/InAppMessaging > - Firebase/Messaging > - Firebase/Performance > - Firebase/Storage > - FontAwesome.swift (~> 1.3.0) > - HockeySDK > - Kingfisher (~> 5.0) > - lottie-ios (~> 2.5) > - OHHTTPStubs/Swift (~> 6.1) > - ParallaxView (~> 2.0) > - SimulatorStatusMagic > - SRCountdownTimer (~> 1.1) > - SwiftLint > > SPEC REPOS: > https://github.com/cocoapods/specs.git: > - AEXML > - Alamofire > - Bolts-Swift > - Charts > - CocoaLumberjack > - Crashlytics > - Fabric > - Firebase > - FirebaseABTesting > - FirebaseAnalytics > - FirebaseAnalyticsInterop > - FirebaseAuthInterop > - FirebaseCore > - FirebaseInAppMessaging > - FirebaseInstanceID > - FirebaseMessaging > - FirebasePerformance > - FirebaseRemoteConfig > - FirebaseStorage > - FontAwesome.swift > - GoogleAppMeasurement > - GoogleToolboxForMac > - GoogleUtilities > - GTMSessionFetcher > - HockeySDK > - Kingfisher > - lottie-ios > - nanopb > - OHHTTPStubs > - ParallaxView > - Protobuf > - SimulatorStatusMagic > - SRCountdownTimer > - SwiftLint > > SPEC CHECKSUMS: > AEXML: 601f41fcaa7bda7605cad153b0f43db9ec006c0f > Alamofire: 16ce2c353fb72865124ddae8a57c5942388f4f11 > Bolts-Swift: 650d72e8017721b1a6bbe43d542c4578f8e5ba6f > Charts: f69cf0518b6d1d62608ca504248f1bbe0b6ae77e > CocoaLumberjack: 2101f8a5508197a305e737d16c5c2e9e2157628c > Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933 > Fabric: f988e33c97f08930a413e08123064d2e5f68d655 > Firebase: 02f3281965c075426141a0ce1277e9de6649cab9 > FirebaseABTesting: 1f50b8d50f5e3469eea54e7463a7b7fe221d1f5e > FirebaseAnalytics: 23851fe602c872130a2c5c55040b302120346cc2 > FirebaseAnalyticsInterop: efbe45c8385ec626e29f9525e5ebd38520dfb6c1 > FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc > FirebaseCore: 52f851b30e11360f1e67cf04b1edfebf0a47a2d3 > FirebaseInAppMessaging: 25e8c4408829928b6727fb461e0aef6a43111467 > FirebaseInstanceID: 7221670e908b41e7ae669600db9d0d201417d0cd > FirebaseMessaging: d740150547f7686b33799f6489f5b69a4706631b > FirebasePerformance: b97b1c301790b4fddc9fe675bca05b71c04e24a6 > FirebaseRemoteConfig: 7e11c65f0769c09bff6947997c209515058c5318 > FirebaseStorage: 29075f874c2b3cf61e5221a62c4ceefc809e5412 > FontAwesome.swift: b4e4c8ccbbecb12f9b592bc533ff237af3706667 > GoogleAppMeasurement: 6cf307834da065863f9faf4c0de0a936d81dd832 > GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d > GoogleUtilities: 111a012f4c3a29c9e7c954c082fafd6ee3c999c0 > GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca > HockeySDK: 15afe6bc0a5bfe3a531fd73dbf082095f37dac3b > Kingfisher: 07067cfacf371117330dceb4b4b8f5c4b691ab42 > lottie-ios: 3fef45d3fabe63e3c7c2eb603dd64ddfffc73062 > nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48 > OHHTTPStubs: 1e21c7d2c084b8153fc53d48400d8919d2d432d0 > ParallaxView: c2df9e49ab58cd8e0cd0b9d449a211d6f76fd53f > Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a > SimulatorStatusMagic: 28d4a9d1a500ac7cea0b2b5a43c1c6ddb40ba56c > SRCountdownTimer: 9c92e444b5403c92f01dd6610299b8c634bc8562 > SwiftLint: 7a0227733d786395817373b2d0ca799fd0093ff3 > > PODFILE CHECKSUM: 2cfd6f0fdb3b10ced5a3e460be38c92d591deb9b > > COCOAPODS: 1.6.0
maksymmalyhin commented 5 years ago

@tfonfara Thank you for the quick response.

I can see you are using Firebase/Messaging as well. Do you have FirebaseMessagingAutoInitEnabled = NO in your Info.plist?

tfonfara commented 5 years ago

@maksymmalyhin No, I don't have any Firebase specific key in the Info.plist