Cannot connect to Firebase / Crashlytics from iPad

Step 2: Describe your environment

  • Xcode version: 11.1
  • Firebase SDK version: 6.13.0
  • Firebase Component: Analytics, Crashlytics
  • Component version: Crashlytics 3.14.0

Step 3: Describe the problem

Steps to reproduce:

When building my application for the simulator, it would appear there is no problem connecting to the Firebase / Crashlytics services. However, when targeting a device, I am unable to connect. The (scrubbed) log looks like the following:

2019-11-27 10:06:30.024555  - <AppMeasurement>[I-ACS036001] Analytics screen reporting is disabled. UIViewController transitions will not be logged.
2019-11-27 10:06:30.606604 6.13.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2019-11-27 10:06:30.624930 [Crashlytics] Version 3.14.0 (144)
2019-11-27 10:06:30.625351 [Crashlytics] Running on iPad6,7, 13.1.3 (17A878)
2019-11-27 10:06:30.627119 [Crashlytics:Crash] Last launch failed: this may indicate a crash shortly after app launch.
2019-11-27 10:06:30.647579 [Answers] Initialized
2019-11-27 10:06:30.649901 [Fabric] Initialized with kit versions: {
2019-11-27 10:06:30.617525 6.13.0 - [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2019-11-27 10:06:30.887183 6.13.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60106000 started
2019-11-27 10:06:30.899510 6.13.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-11-27 10:06:30.920363 6.13.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-11-27 10:06:30.924184 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:30.993421 [GoogleDataTransport][I-GDTCOR000002] There was an error uploading events: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1363c7d50 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://firebaselogging.googleapis.com/v0cc/log/batch, NSErrorFailingURLKey=https://firebaselogging.googleapis.com/v0cc/log/batch, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}
2019-11-27 10:06:31.029315 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.029832 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.030144 6.13.0 - [Firebase/InstanceID][I-IID009000] No keypair info is found with tag com.google.iid-|K|
2019-11-27 10:06:31.030313 6.13.0 - [Firebase/InstanceID][I-IID009006] There's no legacy keypair so no need to do migration.
2019-11-27 10:06:31.030613 6.13.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
2019-11-27 10:06:31.030916 6.13.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-11-27 10:06:31.083383 6.13.0 - [Firebase/Analytics][I-ACS029017] Configuration was not found in database. The configuration will be fetched from the network when necessary
2019-11-27 10:06:31.085209 6.13.0 - [Firebase/Analytics][I-ACS023016] Analytics is ready to receive events
2019-11-27 10:06:31.099219 6.13.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: _sid, 1574877991
2019-11-27 10:06:31.103079 6.13.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: _sid, 1574877991
2019-11-27 10:06:31.116010 6.13.0 - [Firebase/Analytics][I-ACS023080] Setting user property. Name, value: _sno, 7
2019-11-27 10:06:31.118925 6.13.0 - [Firebase/Analytics][I-ACS023087] User property set. Name, value: _sno, 7
2019-11-27 10:06:31.138358 6.13.0 - [Firebase/Analytics][I-ACS023051] Logging event: origin, name, params: auto, _s, {
2019-11-27 10:06:33.141945 [Fabric] failed to download settings Error Domain=FABNetworkError Code=-6 "(null)" UserInfo={retryLimit=1, NSErrorFailingURLStringKey=https://settings.crashlytics.com/spi/v2/platforms/ios/apps/my.app.bundle.id/settings?build_version=0.0.0&display_version=1.1.0&source=1}
2019-11-27 10:06:39.198848 [Crashlytics:Crash:Reports] Submitting report
2019-11-27 10:06:39.199089 [Crashlytics:Crash:Reports] Submitting async /var/mobile/Containers/Data/Application/00000000-0000-0000-0000-000000000000/Library/Caches/com.crashlytics.data/my.app.bundle.id/v3/prepared/00000000-0000-0000-0000-000000000000.multipartmime
2019-11-27 10:06:39.232202 [Crashlytics:Crash:Client] A task currently exists for this upload, skipping
2019-11-27 10:06:45.311619 6.13.0 - [GULReachability][I-REA902004] Network status has changed. Code:2, status:Connected
2019-11-27 10:06:45.312185 6.13.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
2019-11-27 10:06:45.319765 6.13.0 - [Firebase/Analytics][I-ACS033003] Scheduling user engagement timer
2019-11-27 10:06:45.320627 6.13.0 - [Firebase/Analytics][I-ACS002002] Engagement timer scheduled to fire in approx. (s): 3600
2019-11-27 10:06:45.320843 6.13.0 - [Firebase/Analytics][I-ACS023072] Event logged. Event name, event params: _s, {
2019-11-27 10:06:45.321213 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1.403825044631958
2019-11-27 10:06:45.321458 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1.403825044631958
2019-11-27 10:06:45.321648 6.13.0 - [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2019-11-27 10:06:45.321799 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2019-11-27 10:06:45.322059 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1.228907942771912
2019-11-27 10:06:45.322079 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1.228907942771912
2019-11-27 10:06:45.322365 6.13.0 - [Firebase/Analytics][I-ACS023012] Analytics enabled
2019-11-27 10:06:46.675298 6.13.0 - [Firebase/Analytics][I-ACS002001] Measurement timer fired
2019-11-27 10:06:46.675772 6.13.0 - [Firebase/Analytics][I-ACS002003] Measurement timer canceled
2019-11-27 10:06:46.675956 6.13.0 - [Firebase/Analytics][I-ACS023033] Starting data upload
2019-11-27 10:06:46.676101 6.13.0 - [Firebase/Analytics][I-ACS023037] No data to upload
2019-11-27 10:06:46.676427 6.13.0 - [Firebase/Analytics][I-ACS023126] Fetching configuration from the server
2019-11-27 10:06:46.676704 6.13.0 - [Firebase/Analytics][I-ACS900001] Downloading data. Host: https://app-measurement.com/config/app/XXXXX?platform=ios&app_instance_id=XXXXX&gmp_version=60106
2019-11-27 10:06:47.186178 6.13.0 - [Firebase/Analytics][I-ACS901017] Encounter network error. Code, error: -1004, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.189320 6.13.0 - [Firebase/Analytics][I-ACS023127] Fetched configuration. Status code: 0
2019-11-27 10:06:47.189592 6.13.0 - [Firebase/Analytics][I-ACS023128] Unable to get the configuration from server. Network request failed. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.190814 6.13.0 - [Firebase/Analytics][I-ACS023129] Network fetch failed. Will retry later. Code, error: 0, Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x157398fa0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <00000000-0000-0000-0000-000000000000>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
2019-11-27 10:06:47.191829 6.13.0 - [Firebase/Analytics][I-ACS002002] Measurement timer scheduled to fire in approx. (s): 1798.90881896019
2019-11-27 10:06:47.192048 6.13.0 - [Firebase/Analytics][I-ACS023028] Upload task scheduled to be executed in approx. (s): 1798.90881896019
2019-11-27 10:07:00.869685 [GoogleDataTransport][I-GDTCOR000002] There was an error uploading events: Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={NSUnderlyingError=0x1363c76f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://firebaselogging.googleapis.com/v0cc/log/batch, NSErrorFailingURLKey=https://firebaselogging.googleapis.com/v0cc/log/batch, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=61, NSLocalizedDescription=Could not connect to the server.}

Relevant Code:

My initialization code is nothing special. The extra lines to increase logging have no effect on the behavior of the SDK, just its console output:

CrashlyticsKit.delegate = self;

[FIRConfiguration.sharedInstance setLoggerLevel:FIRLoggerLevelMax];
[[Fabric sharedSDK] setDebug:YES];

[FIRApp configure];
[Fabric with:@[[Crashlytics class]]];

1 possible answer(s) on “Cannot connect to Firebase / Crashlytics from iPad

  1. The Pi-hole list was out-of-the-box, so I’m guessing this will be an issue for all default installations. Fortunately the audit log on the device shows you which addresses are blocked and there’s a single button to whitelist them, so it’s easy enough to rectify.

    The biggest challenge is that the Pi-hole otherwise works so well in the background that I’d forgotten I had one.