firebase / firebase-ios-sdk

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

UI API called on a background thread: -[UIApplication isProtectedDataAvailable] #310

Closed plu closed 7 years ago

plu commented 7 years ago

Environment

Problem

Xcode 9 emits a new warning:

Main Thread Checker: UI API called on a background thread: -[UIApplication isProtectedDataAvailable]
PID: 23463, TID: 3630221, Thread name: (none), Queue name: com.google.fira.worker, QoS: 9
Backtrace:
4   Bittrex                             0x0000000100400144 -[FIRASqliteStore monitorContextForDatabaseOperation:] + 476
5   Bittrex                             0x0000000100400350 -[FIRASqliteStore setDatabaseError:operation:] + 92
6   Bittrex                             0x00000001003fd918 -[FIRASqliteStore numberForQuery:parameterValues:error:] + 448
7   Bittrex                             0x000000010041fde8 -[FIRAMeasurement hasDataToUpload] + 60
8   Bittrex                             0x0000000100416fdc -[FIRAMeasurement updateSchedule] + 420
9   Bittrex                             0x0000000100420ee0 -[FIRAMeasurement networkRemoteConfigFetchCompletionHandler:data:error:] + 1588
10  Bittrex                             0x0000000100420828 __36-[FIRAMeasurement fetchRemoteConfig]_block_invoke + 120
11  libdispatch.dylib                   0x000000010583d49c _dispatch_call_block_and_release + 24
12  libdispatch.dylib                   0x000000010583d45c _dispatch_client_callout + 16
13  libdispatch.dylib                   0x000000010584c110 _dispatch_queue_serial_drain + 692
14  libdispatch.dylib                   0x00000001058409a4 _dispatch_queue_invoke + 332
15  libdispatch.dylib                   0x000000010584d104 _dispatch_root_queue_drain_deferred_wlh + 424
16  libdispatch.dylib                   0x0000000105854100 _dispatch_workloop_worker_thread + 652
17  libsystem_pthread.dylib             0x0000000181c9afe0 _pthread_wqthread + 932
18  libsystem_pthread.dylib             0x0000000181c9ac30 start_wqthread + 4

Steps to reproduce:

I can't say when exactly it happened.

This issue is probably also not that important, unless Apple decides in the future to raise in exception in -[UIApplication isProtectedDataAvailable] when called from another thread than the main thread.

JoeySlomowitz commented 7 years ago

I'm having this issue too! Thanks for addressing it.

imdadahad commented 7 years ago

Is there a solution?

ItsMeSandu commented 7 years ago

I think that i have the same Problem:

bildschirmfoto 2017-10-09 um 13 56 46

Enviroment

Other

my test always fails with the following info:

Testing failed:
Early unexpected exit, operation never finished bootstrapping - no restart will be attempted
** TEST FAILED **
[11:42:39]: Exit status: 65

maybe this info help you out.

paulb777 commented 7 years ago

@PetresS You're seeing #69. Updating to the latest Firebase should address it for you.

rohanvasishth commented 7 years ago

I have updated to the latest firebase version but I am still facing the same issue. My firebase version is 4.1.1. @paulb777

paulb777 commented 7 years ago

@rohanvasishth The latest Firebase version is 4.3.0.

rohanvasishth commented 7 years ago

I just upgraded to 4.3.0 and the issue still persists. @paulb777

paulb777 commented 7 years ago

@rohanvasishth As discussed above, some UI API called on a background thread issues were addressed in recent releases. The one with FIRASqliteStore in the backtrace is still under investigation. If you have a different backtrace with the latest release, please open another issue.

morganchen12 commented 7 years ago

We've got a change up internally (172944835) that addresses this particular instance of background queue UIKit access. The other instance reported in the second comment was fixed in an earlier version of Firebase.

If you are running into this issue, please double check the stack trace that Xcode produces. If it's a different stack trace, file a new issue.

I'll update this ticket when the change is merged.

morganchen12 commented 7 years ago

This change has been merged.

morganchen12 commented 7 years ago

This has now been released.