https://kotlinlang.org logo
#coroutines
Title
# coroutines
s

Saiedmomen

01/12/2019, 9:18 AM
When I step through the code it fails on uiScope.launch {...} where uiScope is defined:
It is as if Dispatcher.Main isn't replaced or it is replaced by another one that is also android dependent
d

Dico

01/12/2019, 9:37 AM
Are you not running on Android? It's obvious from the error message that there is no main dispatcher.
You may need kotlinx-coroutines-android dependency
s

Saiedmomen

01/12/2019, 9:39 AM
I'm trying to run a junit test for an android ViewModel. please take a look at preceding posts in the channel
There is a way of replacing Dispatcher.Main for testing as mentioned in the exception message but somehow it isn't working in this instance
d

Dico

01/12/2019, 9:51 AM
Ah, I didn't see those sorry
4 Views