I'm seeing a weird bug with proguard happening whe...
# coroutines
q
I'm seeing a weird bug with proguard happening when using Coroutines 1.0.1. In my Android project I have both coroutines-core and the coroutines-android but when the build is proguarded I get:
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'
l
@quiro Unfortunately, there's no consumerProguard rules yet (may be fixed after 1.3.20 when MPP plugin supports aar publishing). In the meantime, add this into your proguard rules: https://github.com/Kotlin/kotlinx.coroutines/blob/6591c4e5b11bcad7b554e27f00c0f9ee4696d697/core/kotlinx-coroutines-core/resources/META-INF/proguard/coroutines.pro#L1
👍 1
l
FYI R8 on AGP 3.3.0-beta03 seems to pick up those proguard rules in the kotlinx-coroutines-core artifact for me, so I don't need to add them manually. I can see them in the -printconfig output from my proguard config
👍 2