Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Release apk is not working properly?

I had run this flutter build apk to release my App. Now I had build version 2 of that.

Now again I want to release my version 2 App. To get the release apk I again run this flutter build apk again. I get released apk but It was my version 1 released apk. I go to my released directory and deleted my deleted released apk and tried again then also I get version 1 released apk. I tried this too but It is also giving me Version 1 apk

While building version 2 I was testing in debugging mode. everything was/is working fine in dung mode.

Here is Github Link to that App: https://github.com/nitishk72/Flutter-Github-API

like image 504
nitishk72 Avatar asked Apr 17 '18 09:04

nitishk72


People also ask

How do I run the flutter app in release mode?

To compile in release mode, we just need to add the --release flag to the flutter run command and have a physical device connected. Although we can do so, we typically do not use the flutter run command with the --release flag.


1 Answers

If your problem is that the flutter build (APK, bundle) isn't making API calls in a real device, this is because you need to add the Internet permission to Android Manifest before creating the release/build.

By default, "internet use" will work fine on the emulator but not on a real device.

To fix this, simply:

Open the file "android/app/src/main/AndroidManifest.xml" and add the proper user-permission:

<manifest>  ...  <uses-permission android:name="android.permission.INTERNET"/> ... </manifest> 

And then create your build again.

like image 175
Juanma Menendez Avatar answered Sep 25 '22 08:09

Juanma Menendez