简体   繁体   中英

In flutter my build apk file is not working properly

I have read all the available solutions on this topic none of them worked for me.I have deleted all build file using flutter clean and also uninstalled the app from the phone before every run The apk file built using flutter run --release works fine. The apk file built using flutter build apk doesn't working properly. I don't know why it is happening?

My problem is similar to Android Studio generating old version APK

Although this method is a bit vague and old fashioned, but it still works.

Step One: Run your android device as a virtual emulator.

Step Two: Run main.dart in your android device. This will install the app in your device.

Step Three: Go to Play Store and install this app called APK Extractor.

Step Four: Extract your APK from the app.

The APKs created through this are smaller and more efficient as compared to the ones created using Android Studio and work pretty well.

If you are using Android Studio, I would recommend building the apk through the IDE.

On the top menu bar of Android Studio, select 'Build', 'Flutter', then 'Build APK'.

I haven't had any issues when building an app this way.

Do following:

  • flutter clean
  • Check version number and name in the pubspec.yaml
  • Open the Android part in Android Studio, try to build from there

Do the following steps may be helpful for you

  1. Open android studio do "Invalid Caches/Restart" from the menu bar
  2. flutter clean and try to make a build from android studio

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM