You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEAT] Add proguard rules to documentation to help devs when releasing their final apps #13
Hi team,
While integrating paystack_flutter_sdk into a Flutter app, I ran into runtime errors due to R8/ProGuard stripping essential classes used internally by Retrofit and OkHttp.
After investigation, I figured out a set of ProGuard rules that resolve the issue and allow verifyAccessCode and other SDK methods to work correctly in release mode.
I think it would be helpful to other developers if these rules were included in the official documentation or README.
Here's the working snippet:
Kotlin serialization
-keepattributes Annotation, InnerClasses
-dontnote kotlinx.serialization.AnnotationsKt
-keepclassmembers class kotlinx.serialization.json.** {
*** Companion;
}
-keepclasseswithmembers class kotlinx.serialization.json.** {
kotlinx.serialization.KSerializer serializer(...);
}
Kotlin general
-keep class kotlin.** { ; }
-keep class kotlinx.* { *; }
-keepclassmembers class **$WhenMappings {
;
}
-keepclassmembers class kotlin.Metadata {
public ;
}
Keep Kotlin Parcelize
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keepclassmembers class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
Activity