For the complete documentation index, see llms.txt. This page is also available as Markdown.

Why does the Flutter SDK fail in release but work in debug?

Code that works in debug but fails in Android release builds means R8 minification (disabled in debug) is stripping or renaming SDK classes.

Code that works in debug but fails in Android release builds means R8 minification (disabled in debug) is stripping or renaming SDK classes. Add app-level ProGuard/R8 keep rules for the relevant Terra package and reference your proguard-rules.pro in the release buildType:

  • Standard SDK: -keep class co.tryterra.** { *; }

  • Real-time SDK: -keep class co.tryterra.terrartandroid.** { *; }

Gson 'abstract class can't be instantiated' crashes with obfuscated class names occur because Gson instantiates Terra model classes via reflection. Add the keep rule plus -keepattributes Signature and Annotation.

If you still see obfuscated names, your proguard-rules.pro is not being picked up:

  • Confirm the release buildType references it.

  • With Expo/EAS, run prebuild so android/app/proguard-rules.pro is applied.

If you use the direct Samsung Health integration, also keep Samsung's classes: -keep class com.samsung.android.** { *; }. Alternatively, disable minification for the release build. See the Android setup docs for more.

Last updated

Was this helpful?