Unhandled Exception: Connection failed in Flutter Xcode (AppClip)

45 Views Asked by At

Code:

String url = "https://########.com/api/"
Response response = await http.get(Uri.parse(url),
headers: {
'Accept': "application/json",
},
);

Also added:

\<key\>com.apple.security.network.client\</key\>
\<true/\>

Error:

\[VERBOSE-2:dart_vm_initializer.cc(41)\] Unhandled Exception: Connection failed
\#0      IOClient.send (package:http/src/io_client.dart:94:7)
\<asynchronous suspension\>
\#1      BaseClient.\_sendUnstreamed (package:http/src/base_client.dart:93:32)
\<asynchronous suspension\>
\#2      \_withClient (package:http/http.dart:166:12)
\<asynchronous suspension\>
\#3      Future.timeout.\<anonymous closure\> (dart:async/future_impl.dart:888:15)
\<asynchronous suspension\>
\#4      HomeScreenRestApi.getHomeScreenData     (package:thecanadianhomes/appclip/rest_api/home_screen/home_screen_rest_api.dart:37:27)
\<asynchronous suspension\>
\#5      HomeScreenViewModel.getHomeScreenData     (package:thecanadianhomes/appclip/screen/home_screen/home_screen_view_model.dart:178:9)
\<asynchronous suspension\>
\#6      HomeScreenViewModel.init     (package:thecanadianhomes/appclip/screen/home_screen/home_screen_view_model.dart:37:5)
\<asynchronous suspension\>

I tried Running it in xcode and getting this error while running AppClip on Xcode

0

There are 0 best solutions below