RaSha
RaSha

Reputation: 1482

Flutter app is so slower in release build than debug

I built an app in flutter which loads data from the server and also fetches it based on the user requests. I've noticed a problem recently. My app is very slower when loading data in release build than debug one. The app almost gets stuck when loading data in release mode but in debug mode, it loads data in less than two seconds. Does anyone have any suggestions on how I can fix this?

I'm running the debug build on an Asus laptop with 12g ram win10 and release on samsung m20 and huawi redmi. The app gets stuck on both of physical devices when loading. I don't know what caused this problem in my app. I tested similar apps and they had an acceptable loading speed in both release and debug builds on these devices.

Upvotes: 4

Views: 2399

Answers (1)

MαπμQμαπkγVπ.0
MαπμQμαπkγVπ.0

Reputation: 6737

In this kind of situation, I suggest try to target the APK of your device in which the Flutter app is running. flutter build apk will build a 32-bit APK by default.

Example:

If you want a 64-bit APK then you'll need to specify that as the target.

Try using flutter build apk --target-platform=android-arm64

flutter run will build an APK targeting the attached device. So if the device is 64-bit, then flutter run will build a 64-bit APK.

Upvotes: 1

Related Questions