Not a big deal, but I am wondering if the Android build process should really add this to every release APK (gets placed into the root folder).
Tested with Android Studio 4.0.1 and 4.2.0 Canary 12 using the latest Kotlin and Coroutines Android plugins/libraries.
As a workaorund it should be safe to use
packagingOptions {
exclude 'DebugProbesKt.bin'
}
for release builds, right?
Yes. It is safe to exclude. I wonder if we can also add the corresponding exclusion options directly to the library. Is it even possible?
Fixed by providing how-to documentation in 1.4.0
For everyone reading this issue, this was added to the README.
@qwwdfsad Can you clarify the how-to instructions, please? They are hard to actually understand and follow. They say "no loss of functionality", but it would appear that I will lose some mystery debug capabilities. The instructions appear to remove these capabilities from both release and debug builds, and not being a Gradle wiz, like most devs, I'm not sure how to limit this to only release builds. My guess, after some meddling, would be to put it in android { buildTypes { release, but I can't say whether that actually does the right thing.
Or maybe the Gradle snippet is usable exactly as written and meant in a "just trust us" sense? Does "DebugProbesKt.bin" get introduced only in release build dependencies? "Just trust us" is generally unwise for a dev. Please add additional explanation.
but it would appear that I will lose some mystery debug capabilities.
Could you please elaborate on what exact part of debug functionality disappears when you are applying packagingOptions? The instruction tells nothing about debugging capabilities of kotlinx.coroutines and explains that "a resource file that is not required for the coroutines to operate
normally and is only used by the debugger" (meaning IDEA debugger, not application-level capabilities)
The instructions given in the README say that the resource file is used by the debugger, suggesting that when I remove the resource file, the debugger will lose some functionality. This would be undesirable when debugging a debug build. I don't know what debug functionality is lost. Or is DebugProbesKt.bin just needed for some standalone debugger like jdb or Eclipse, and if I debug in IDEA or Android Studio, then I would not need the resource file?
Applying the lines from the instructions appears to remove this debugging functionality from both debug builds and release builds. Debug and release builds generally use the same Gradle build script. The instructions need to specify how to remove debugging functionality from release builds only, without also removing them from debug builds. Debug builds are specifically intended for debugging. One would want maximum debugging capabilities in this case and not lose any.
An Android Gradle Plugin expert at your organization may be able to solve this problem. @G00fY2 may know the answer, too.
DebugProbesKt.bin is needed to enable the builtin support for coroutines debugger in IDEA. This functionality does not work with Android debugging at all, so no debugging capabilities are lost when packagingOptions are applied.
You don't have to worry about it and that's why we also particularly added no loss of functionality
Great to know, thank you! Please add that to the README instructions to clarify why the file is safe to remove from all APKs. Something like DebugProbesKt.bin is not used when debugging on Android.
Most helpful comment
For everyone reading this issue, this was added to the README.