Configure R8/Proguard Rules for Appxiom Plugin in Flutter (Android platform)
Detailed documentation is available at Appxiom Flutter Plugin Documentation.
To ensure Appxiom Plugin functions correctly in your Android release builds, you must configure R8/Proguard rules to prevent essential classes and annotations from being obfuscated. Proper configuration also preserves stacktrace details for effective debugging and error analysis in the Appxiom dashboard.
Required Proguard Rules
Add the following rules to your proguard-rules.pro file:
-keep class tech.appxiom.android.core.* { *; }
-keepclassmembers class * {
@tech.appxiom.android.core.annotation.AX *;
}
-keepclassmembers class androidx.lifecycle.** {
*;
}
These rules ensure that Appxiom Plugin core classes and the @AX annotation are retained and not obfuscated during the build process.
Preserve Source File and Line Numbers
To keep exact line numbers and source file names in stacktraces (for accurate deobfuscation and debugging), add:
-keepattributes SourceFile,LineNumberTable
Mapping File Backup
Always back up the mapping file for each production build. This file is required to deobfuscate stacktraces in the Appxiom dashboard.
Location of mapping file:
project-folder/app/build/outputs/mapping/release/mapping.txt