Home > Net >  My flutter app contains with some API calls. After building APK, it's says null value
My flutter app contains with some API calls. After building APK, it's says null value

Time:11-15

I have made an app that fetches some data by API.

In my emulator, the app fetches data perfectly and shows the data correctly too. But whenever I build an APK and install it on my phone the data doesn't show up.

Why is it happening? In the emulator, it's works.

For fetching data, I used future builder

CodePudding user response:

Add:

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

your AndroidManifest.xml

CodePudding user response:

As flutter docs say on reviewing the app manifest you should locate your AndroidManifest.xml file located in [project]/android/app/src/main. Then inside manifest tag insert Android permission element as

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

The code above follows the syntax mentioned here.

According to flutter docs:

The standard template does not include this tag but allows Internet access during development to enable communication between Flutter tools and a running app.

  • Related