I have a Flutter (3.0.4) app that I run on Android 12 (real device and emulator) for testing.
Main Flutter dependencies are shared_preferences 2.0.15, flutter_riverpod 1.0.4, intl 0.17.0, i18n_extension 5.0.0 and syncfusion_flutter_charts 20.1.58.
Gradle version seems to be 7.1.0 (note: also listed as 4.0.0 for android/build.gradle -> buildscript -> ext -> gradleVersion, so not sure about that).
There is no issue when running in debug mode (flutter run
).
But when running in release mode (flutter run --release
), and switching to the specific app page using charts with SyncFusion, I get the following error displayed directly on the app page:
Note that there is no class "h" in my code.
Following some of the suggestions here and here, I've been trying the following:
- Add lintOptions in android/app/build.gradle -> android {}
- Downgrading Gradle to 3.6 (not fond of that solution, as you can guess, but tried anyway)
- Adding the decorators
@Keep
and/or@Serializable
to the only Kotlin class in my code (I have one custom Kotlin class).
None of those solutions worked. I've been also looking at this, but not sure to understand how it can applies to my case.
I am under the impression that the error comes from SyncFusion Flutter module when building in release mode, since the error appears only on the page using SyncFusion, not any other.
Any idea on what's happening?