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.
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
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.
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.
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