need your kind help.
The App is giving error: (both in Emulator and Android Phone)
"SocketException: Failed host lookup: ‘api’ (OS Error: No address associated with hostname, errno=7)
What I have tried:
added to the Android manifest file :
uses-permission android:name=“android.permission.INTERNET”
but still this problem persists…any idea where I may be wrong,
Thanks in advance…
Absar
just curious to know…
On Flutter site (and StackOverflow) it’s mentioned to add this setting (uses-permission android:name=“android.permission.INTERNET”.) to the manifest file while using http package as required to fetch data from the internet.
But, in the sample code with the book - there is no mention of this Android manifest.xml file setting : uses-permission android:name=“android.permission.INTERNET”. …And this works too.
Does this mean that we don’t have to add this setting to the manifest file anymore?
Thanks.
You are correct that I needed to mention this in the chapter. What is happening is that the Android package has a debug folder with a manifest in there that has the internet permission. This allows it to work while testing but won’t work for a release version. I’ve always wondered why the standard Android template never added this permission by default as almost all apps need it.