Has anyone experienced a missing MainDispatcher on...
# android
m
Has anyone experienced a missing MainDispatcher only manifesting in release builds distributed via google play?
👌 1
K 1
😶 1
j
Oof good luck. I can't remember what we did to fix it, but I remember the pain.
l
i’ve never seen it before, can you be more specific? or there is evidence of error.
g
Maybe some issue with R8? Or it works fine in release builds locally?
m
@lam bui Specifically
Copy code
Caused by java.lang.IllegalStateException
Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
when we call
launchOnResumed
from an appcompat activity. The lifecycle lib tries to fetch the main dispatcher and fails.
@gildor R8 is our primary suspect but yes, as you stated, all of this works totally fine locally. The issue only occurs on release builds distributed via google play. WE are not the only ones who have misplaced a main dispatcher but everything that everyone has suggested has not made a difference.
g
Have you tried to debug it by dumping classpath and see what is going on there I would also suggest to just add a debug on your Application.onCreate which will try to resolve main dispatcher and maybe log classpath or maybe some additional information in case if Main dispatcher cannot be loaded In general Main dispatcher is resolved dynamically on runtime, so if class is not there it fails