Flutter app doesn't work in apk release mode

30 Views Asked by At

The Flutter app I'm currently building works perfectly in debugging mode on the emulator, but when i create an apk and install it on my real phone it doesn't work as intended.

I think it might has to do something with permissions because in my app i download some json from the internet. I can't find a solution though that works.

1

There are 1 best solutions below

0
AmirHossein On BEST ANSWER

Since you are getting data from server, you need to add internet permission so your app will be able to connect to the internet. simply adding

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

on

android/app/src/main/AndroidManifast.xml 

Add this line, it will Fix your problem.

For example:

<manifest 
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.movie_app">
<uses-permission android:name="android.permission.INTERNET"/>  //Add this line here
<application
    android:label="movie_app"
    android:name="${applicationName}"
    android:icon="@mipmap/ic_launcher">

Happy Coding :)