ClientException: Failed to connect error on flutter desktop macos. iOS simulator is working and fetching.
Can you paste the error stack if there is any?
@mainawycliffe It's silently fails. Should it work at all? Or maybe it weren't tested yet?
when I tried flutter desktop on mac a month earlier, I had connectivity issue. I think you have to do some configuration to adhere to platform security. Though I looked now I couldn't find the specifics, but it was mentioned in the issue list and the wiki.
May be you can try whether a simple http request works from your app to rule out unrelated issue.
@onemanstartup it's not yet tested, which is why we need your help. You can try @bsr203 suggestion to figure out what the issue is, maybe the exception is being ignored as it was not foreseen. We are hoping for feedback to help make it compatible with all platforms.
Ok. It works. Found this SO question https://stackoverflow.com/questions/57841871/flutter-http-get-fails-on-macos-build-target-connection-failed and this documentation.
I made changes in macos/Runner/DebugProfile.entitlements
<key>com.apple.security.network.client</key>
<true/>
And now it's working.
Yeah, it's platform specific, but I hope it will help somebody. I think is can be closed now.
@onemanstartup That's amazing, would it be possible for you to add the above to read me? And we really need to build a docs site now.
Most helpful comment
Ok. It works. Found this SO question https://stackoverflow.com/questions/57841871/flutter-http-get-fails-on-macos-build-target-connection-failed and this documentation.
I made changes in
macos/Runner/DebugProfile.entitlementsAnd now it's working.
Yeah, it's platform specific, but I hope it will help somebody. I think is can be closed now.