I’m getting ANR when `kotlinx.coroutines.MainScope...
# android
m
I’m getting ANR when
kotlinx.coroutines.MainScope()
is being called from my Hilt generated code. 90% of ANRs are on Android 11 coroutines version = 1.7.1
c
well, doing stuff in the main scope which includes the main dispatcher can result in ANR’s because you block the main thread. 😉
m
but it’s just being created. app is blocking on
MainScope()
call-site
actually now it’s not blocking on creation, I found a code that’s using that scope right after it’s being created. now I’m not confused any more 😄
c
Hilt is creating the injected things when actually called. So you could always assume that it is used somewhere when injected.