I have developed app with Flutter and when i released app on Google Play Store I am getting these crashes but couldn’t find any working solution. Please help me with this. Any help will be appreciated.


I resolved this problem by preventing the creation of x86 builds because Flutter doesn't have support for those builds.
To accomplish this, include the following abiFilters in your android/app/build.gradle:
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
}
Your problem seems to be with android and obfuscation making libflutter.so unreachable.
Go ahead and create at ./android/app a file named
proguard-rules.pro
(to be clear, it will be placed at /android/app/proguard-rules.pro)
and add the following rules to it
#Flutter Wrapper
-keepattributes AutoValue
-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.** { *; }
EDIT: Also add this to android/app/build.gradle, at buildTypes > release:
buildTypes {
release {
//…
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
}
}
I also used at the same time, the same solution as @Dharam did:
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
save it and flutter clean your project and compile it again.
What this does is tell the obfuscation service (proguard or R8) to keep these files out of obfuscation (it is ok since there's no point on securing files that are already open-source) I have inserted the firebase stuff too since you're using firebase packages and it caused some issues for me as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With