It Normally Happens you just need to add a file with little settings :D
- Create A proguard rule to define what's to prevent
Here is What's Worked for me, based on your App you might need to add more things specific to your solution. :D
- Create A ProGuard File
Code:
Create a File: proguard-rules.pro
## Flutter wrapper
-keepattributes Signature
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class com.google.firebase.** { *; }
-keepattributes JavascriptInterface
-keepattributes Annotation
-dontwarn com.razorpay.**
-keep class com.razorpay.** { *; }
-optimizations !method/inlining/
-keepclasseswithmembers class * {public void onPayment*(...);}
-keepclassmembers class * {@android.webkit.JavascriptInterface ;}
-keepclassmembers class com.yourpackagehere.models.** { *; }
-dontwarn io.flutter.embedding.**
- And to Add it to app level gradle file
Code:
Inside build.gradle
buildTypes {
release {
shrinkResources false
signingConfig signingConfigs.release
minifyEnabled false
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Hope this Helps you :D