kotlinx.coroutines
kotlinx.coroutines copied to clipboard
Provide a way to enable stacktrace recovery in Android release build
As mentioned in https://github.com/Kotlin/kotlinx.coroutines/blob/master/ui/kotlinx-coroutines-android/README.md#optimization
When optimizations are enabled with R8 version 1.6.0 or later the following debugging features are permanently turned off to reduce the size of the resulting binary:
- Debugging mode
- Stacktrace recovery
- The internal assertions in the library are also permanently removed.
There is should be a way to opt-out this behaviour.
Yes, please. I really need the stack trace of a kotlinx.coroutines.JobCancellationException so I can try to reproduce the reported crash. Is there a way to enable stack trace recovery in release builds?
See #3611 for some prior art.
What is causing stacktrace recovery to not work after R8? Is it rules that the kotlinx.coroutines library is embedding?
Yes, embedded rules are the main suspect here
It'd be great to have those in a code-free extra artifact that the -android module depends on, and give us a way to exclude it.
I mean, just using Gradle APIs should suffice to exclude it if it's in a separate artifact.