kotlinx.coroutines icon indicating copy to clipboard operation
kotlinx.coroutines copied to clipboard

Provide a way to enable stacktrace recovery in Android release build

Open varahash opened this issue 5 years ago • 6 comments

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.

varahash avatar May 07 '20 09:05 varahash

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?

Thomas-Vos avatar May 10 '21 10:05 Thomas-Vos

See #3611 for some prior art.

dkhalanskyjb avatar May 03 '23 09:05 dkhalanskyjb

What is causing stacktrace recovery to not work after R8? Is it rules that the kotlinx.coroutines library is embedding?

LouisCAD avatar Apr 15 '24 10:04 LouisCAD

Yes, embedded rules are the main suspect here

qwwdfsad avatar Apr 16 '24 13:04 qwwdfsad

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.

LouisCAD avatar Apr 16 '24 20:04 LouisCAD

I mean, just using Gradle APIs should suffice to exclude it if it's in a separate artifact.

LouisCAD avatar Apr 16 '24 20:04 LouisCAD