Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter provider not working in release apk, but working fine in debug mode

the provider should work to provide real time updates to consumers but only works in debug mode and not release mode. do i have to use the state full widget again to update the ui with set state, any clue?

like image 490
mamena tech Avatar asked Jan 23 '20 22:01

mamena tech


People also ask

How do I run the flutter app in release mode in emulator?

Now when you press F5 to launch the application, the corresponding launch mode will be used. By default, when running in profile mode memory usage will automatically be shown on the status bar.

How do you test 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.

What is the difference between debug mode and profile mode flutter?

A quick summary for when to use which mode is as follows: Use debug mode during development, when you want to use hot reload. Use profile mode when you want to analyze performance.


2 Answers

Might be possible that you missed to add internet permission in AndroidManifest.xml

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

We have to add Internet permission in AndroidManifest.xml file for release build. It is working fine in debug mode. If you have been calling api call in provider. Same mistake I have done and resolved that issue.

like image 113
Mavya Soni Avatar answered Nov 15 '22 07:11

Mavya Soni


If you add in the 2 AndroidManifest.xml files the internet permission

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

and it is still not works, so add this in the 2 files in the application tag

android:usesCleartextTraffic="true"
like image 28
Ibra Avatar answered Nov 15 '22 09:11

Ibra