https://kotlinlang.org logo
Title
c

clark

04/01/2021, 3:09 AM
I get a weird exception when I try to use a multiplatform apollo client in iOS. The error I get is not very helpful:
KotlinException=kotlin.AssertionError: Assertion failed
I've seen a couple sample projects, like the one from Apollo's github, and it has an iOS specific implementation of the repository that does some work with the coroutines scope. Is that what might be causing my issue? Anyone else using apollo client in a multiplatform project in iOS and able to successfully make queries and mutations?
m

mbonnin

04/01/2021, 11:14 AM
I'm guessing you're hitting the main thread precondition?
Apollo Android assumes that flows are started and collected on the main thread on iOS so that might be an explanation but without more context, it could very well be something completely different
❤️ 1
c

clark

04/01/2021, 2:05 PM
Turns out it was the main thread precondition
I just copied what you did in the multiplatform sample and it worked
m

mbonnin

04/01/2021, 2:06 PM
Makes sense... Ultimately, we should lift that restriction but the concurrency stuff has a lot of moving parts
c

clark

04/01/2021, 2:09 PM
No worries at all. Anything concurrency is difficult, not to mention crossplatform concurrency with strict rules. Thanks for the help!