From 2ae2a3da1899cc57e2e63a31c225973064ac3a90 Mon Sep 17 00:00:00 2001 From: Chad Curtis Date: Tue, 2 Jun 2026 03:28:48 -0500 Subject: [PATCH] android: add R8 keep rules for barcode-scanner Gson references R8 release minification failed on a missing com.google.gson.annotations .SerializedName referenced by the OutSystems barcode plugin. Suppress the Gson missing-class warning, keep annotations, and keep the plugin's model classes so serialized fields survive shrinking. --- android/app/proguard-rules.pro | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 956f8283..ac1720e0 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -19,6 +19,14 @@ -dontwarn okio.** -keep class okhttp3.** { *; } +# Barcode scanner plugin (@capacitor/barcode-scanner -> OutSystems ionbarcode) +# references Gson's @SerializedName, but Gson isn't on the release classpath. +# Suppress the missing-class warning, keep the annotation attribute, and keep +# the plugin's model classes so R8 doesn't strip/rename serialized fields. +-dontwarn com.google.gson.** +-keepattributes *Annotation* +-keep class com.outsystems.plugins.barcode.** { *; } + # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable