-
Notifications
You must be signed in to change notification settings - Fork 1.9k
DebugProbesKt.bin gets shipped in release apk #2274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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? |
) Added instructions to work around #2023 Also, the answer to #2274 is now documented. Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
Fixed by providing how-to documentation in 1.4.0 |
For everyone reading this issue, this was added to the README. |
…tlin#2288) Added instructions to work around Kotlin#2023 Also, the answer to Kotlin#2274 is now documented. Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
…tlin#2288) Added instructions to work around Kotlin#2023 Also, the answer to Kotlin#2274 is now documented. Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
@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 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. |
Could you please elaborate on what exact part of debug functionality disappears when you are applying |
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 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. |
You don't have to worry about it and that's why we also particularly added |
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 |
Fixes: #6920 Certainly NuGet packages pull in Kotlin-related artifacts which aren't required at runtime. These artifacts contribute to `.apk` package size. The [recommendation for native Android developers][0] is to explicitly exclude these artifacts by using `packagingOptions`: packagingOptions { exclude 'DebugProbesKt.bin' } Xamarin.Android and .NET SDK for Android developers don't use Gradle, so the above snippet is not useful. Add support for a new `@(AndroidPackagingOptionsExclude)` item group. This contains a "search pattern" a'la the `searchPattern` parameter of [`Directory.EnumerateFiles(path, searchPattern)`][1], in which: * `*` matches 0 or more characters * `?` matches 1 character. The default items within `@(AndroidPackagingOptionsExclude)` are: * `DebugProbesKt.bin` * `*.kotlin_*` Files which match the search patterns within `@(AndroidPackagingOptionsExclude)` are *excluded* from `.aab` and `.apk` files, reducing app size. [0]: Kotlin/kotlinx.coroutines#2274 [1]: https://docs.microsoft.com/en-us/dotnet/api/system.io.directory.enumeratefiles?view=net-6.0#system-io-directory-enumeratefiles(system-string-system-string)
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
for release builds, right?
The text was updated successfully, but these errors were encountered: