-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs(flutter): document Android flavor workaround for split-debug-info #17268
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
base: master
Are you sure you want to change the base?
Changes from all commits
3ca2e79
fa8dbe9
4ab3ea2
8ac1961
3f7e7cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,6 +119,40 @@ The `--split-debug-info` option requires setting an output directory. The direct | |
|
|
||
| Flutter's `build web` command requires setting the `--source-maps` parameter to generate source maps. See [Flutter GitHub Issue](https://github.com/flutter/flutter/issues/72150#issuecomment-755541599) for more information. | ||
|
|
||
| ### Symbolication issues with `--split-debug-info` and Android flavors | ||
|
|
||
| If your app uses Android product flavors together with `--split-debug-info`, Flutter/Gradle may compile another release flavor and overwrite the selected flavor's `.symbols` files. This was confirmed for Flutter version 3.32.0 and later. As a workaround, ignore non-selected release variants in `android/app/build.gradle.kts` and pass the active flavor through the build command: | ||
|
|
||
| ```kotlin | ||
| android { | ||
| variantFilter { | ||
| // Only keep the selected release flavor to avoid split-debug-info | ||
| // being overwritten by other release variants. | ||
| if (buildType?.name != "release") return@variantFilter | ||
|
|
||
| val activeFlavor = (project.findProperty("active-flavor") as String?) | ||
| ?.lowercase() | ||
| ?: return@variantFilter | ||
|
|
||
| val variantFlavors = flavors.map { flavor -> flavor.name.lowercase() } | ||
| if (activeFlavor !in variantFlavors) { | ||
| ignore = true | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Build with matching values for `--flavor` and `active-flavor`: | ||
|
|
||
| ```bash | ||
| flutter build appbundle \ | ||
| --flavor=googlePlay \ | ||
| --target=lib/main_googlePlay.dart \ | ||
| --obfuscate \ | ||
| --split-debug-info=debug_info/googlePlay \ | ||
| --android-project-arg=active-flavor=googlePlay | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The suggested workaround may fail silently. If the Suggested FixVerify that Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| ``` | ||
|
|
||
| ## Issues with native crashes on Linux and/or Windows | ||
|
|
||
| By default the Sentry Flutter SDK will enable native crash reporting on Linux and Windows with `crashpad`. | ||
|
|
@@ -131,7 +165,7 @@ On Linux, compiling your Flutter Desktop app with the crashpad backend can fail | |
|
|
||
| - Update your clang to at least version 13, then try again. | ||
| - If you still encounter errors, please file an issue on our [Sentry Dart GitHub repository](https://github.com/getsentry/sentry-dart/issues/). | ||
|
|
||
| ### Java or JNI Errors when compiling on Flutter Desktop | ||
|
|
||
| Since Sentry Flutter SDK version `9.0.0`, we improved how the SDK works on Android by switching from method channels to JNI (Java Native Interface) for certain operations. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.