Chapter 11 - Networking

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

What’s the URL you are using to access the recipes API?

https://api/edamam.com/search
Thanks

There’s a typo. It should be
https://api.edamam.com/search

oops…my mistake…many many thanks…

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.

FYI we do touch on android.permission.INTERNET but that happens in chapter 17
https://www.raywenderlich.com/books/flutter-apprentice/v2.0/chapters/17-build-release-an-android-app

@kevindmoore @funkyboy Many thanks for your kind replies.