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.

- 487
- 6
- 21
-
Have you found the solution ? – Ankit Mahadik Dec 07 '22 at 12:01
-
No. But I think it is due to facebook_audience_network sdk. See this thread https://stackoverflow.com/questions/63047553/apex-com-android-runtime-lib64-bionic-libc-so-abort160-abort-crash-in-andro – Muhammad Shafique Dec 09 '22 at 03:06
-
Did you found the solution Mr Muhammad? – Mustafa Jan 23 '23 at 15:44
-
@Mustafa no i didn’t find any solution – Muhammad Shafique Jan 24 '23 at 05:20
-
I will use Firebase Crashlytics to check erorrs, I hope it will help me. – Mustafa Jan 24 '23 at 14:39
-
It shoes the same error. I tried it didn’t helped me – Muhammad Shafique Jan 25 '23 at 10:28
2 Answers
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.

- 2,416
- 3
- 15
- 28
-
-
@Sos. i just edited my answer with build.gradle instructions too, did you add that to your file when using proguard rules? – Fernando Rocha Aug 26 '23 at 05:00
-
1Yes, I have `proguardFiles 'proguard-rules.pro'` in `app/build.gradle` and even with `ndk.abiFilters`, it didn't work. I voted your solution because obfuscation may cause errors and no point on securing files that are already open-source, like you said. And I hope Flutter fix this very old error. – Sos. Aug 27 '23 at 07:04
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'
}
}
}

- 515
- 2
- 9