Goo day friends! I am new to Flutter and I have been experimenting on fetching data via REST API. On Android Studio, everything works just fine, so I suppose there's nothing wrong with my code.
Things I did to make sure my code works: 1.) Run the code in android simulator; 2.) Run the code using real device (enabling USB Debugging).
And it works just fine.
But when I build an apk file out of it and install it on my device, it no longer makes the API call (or is unable to?). I made it so, when the app runs initState()
, it waits for the data to be loaded. While the data is not yet available, a CircularProgressIndicator()
takes the entire screen.
If I run the app via the installed apk file, it's just CircularProgressIndicator()
. Meaning, no data is being loaded and displayed. But when I run the code in AndroidStudio, the data is shown..
I am using http
package. I'm not sure what I'm doing wrong, or what I'm missing.
Other things to note: I did not change anything in my AndroidManifest
file, and just followed all the steps on building apk file in Flutter through the official documentation.