Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application state being called from background thread #147

Closed
romk1n opened this issue Sep 19, 2017 · 9 comments · Fixed by #148
Closed

application state being called from background thread #147

romk1n opened this issue Sep 19, 2017 · 9 comments · Fixed by #148

Comments

@romk1n
Copy link

romk1n commented Sep 19, 2017

We getting this warning in the log can you guys check your code?

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

@djih
Copy link
Member

djih commented Sep 19, 2017

@romk1n thanks for reporting. What version of the SDK are you on?

@TimothyDavidW
Copy link

Hi I am also experiencing this on 4.0.1 after updating to ios11.

Backtrace:
4 Amplitude_iOS 0x000000010537c8f4 -[Amplitude initializeApiKey:userId:setUserId:] + 684
5 Amplitude_iOS 0x000000010537c580 -[Amplitude initializeApiKey:] + 84

line 480 in the amplitude.m is where this is occurring.

@romk1n
Copy link
Author

romk1n commented Oct 9, 2017

@djih sorry missed your message it is latest and previous version. Thanks.

@danielgalasko
Copy link
Contributor

Any update on this? Its actually crashing our CI now for some reason

@djih
Copy link
Member

djih commented Oct 13, 2017

@danielgalasko @romk1n I have a fix on a branch. I've tested it myself in our demo app but if you guys have a chance can you test it out? To install via Cocoapods: pod 'Amplitude-iOS', :git => 'https://github.com/Amplitude/Amplitude-iOS.git', :branch => 'main-thread-violation'. Otherwise I will just merge it and release a new version EOD today, thanks

@djih djih closed this as completed in #148 Oct 13, 2017
@djih
Copy link
Member

djih commented Oct 13, 2017

This is fixed with v4.0.2 thanks!

@danielgalasko
Copy link
Contributor

awesome stuff!!! Thanks for the release @djih 🙌

@romk1n
Copy link
Author

romk1n commented Oct 16, 2017

@djih thanks, I just tried new version and still receiving the warning [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

@djih
Copy link
Member

djih commented Oct 16, 2017

@romk1n do you have more information like stack trace? When investigating the issue I was able to reproduce the warning in our iOS Demo app, and I verified that the fix stops the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants