# No host specified in URI error

**URL:** <https://community.sendbird.com/t/no-host-specified-in-uri-error/8441>\
**Category:** Flutter\
**Tags:** chatsdk\
**Created:** [October 16, 2023, 8:54am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441 "2023-10-16T08:54:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zvgandam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zvgandam/32/4590_2.png) [@zvgandam](https://community.sendbird.com/u/zvgandam)\
**Post date:** [October 16, 2023, 8:54am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/1 "2023-10-16T08:54:41Z")

</div>

This error occurs in the ‘MessageCollection’ when join a channel from the channel list after logging out and back in.

The error disappears when the app is re-launched.

_Here’s the error_

> Invalid argument(s): No host specified in URI https:/v3/group\_channels/sendbird\_group\_channel\_122943098\_142cf043fae1da97f4ea1e8dc5909ce64663d3d9/messages?with\_sorted\_meta\_array=false&include\_reactions=false&include\_thread\_info=false&include\_parent\_message\_info=false&prev\_limit=20&next\_limit=0&include=true&reverse=false&show\_subchannel\_messages\_only=false&is\_sdk=true&include\_poll\_details=true&message\_ts=9223372036854775807

_The error occurs even if you write apiHost on the connection._

```auto
 await SendbirdChat.connect(
      userId,
      apiHost: 'api-$appId.sendbird.com',
  );

```

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [October 17, 2023, 4:26am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/2 "2023-10-17T04:26:24Z")

</div>

Hello @zvgandam,

Is there any reason you’re trying to specify a custom apiHost? You should not specify one and it will automatically generate the url internally.

---

<div class="post-metadata">

**Author:** ![zvgandam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zvgandam/32/4590_2.png) [@zvgandam](https://community.sendbird.com/u/zvgandam)\
**Post date:** [October 17, 2023, 4:39am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/4 "2023-10-17T04:39:59Z")

</div>

Hello, @Tyler

I just wrote it down because the host was not specified even when it was not specified

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [October 17, 2023, 6:58am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/5 "2023-10-17T06:58:02Z")

</div>

@zvgandam Did you init the SDK first?

```auto
SendbirdChat.init(appId: 'APP_ID');

```

---

<div class="post-metadata">

**Author:** ![zvgandam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zvgandam/32/4590_2.png) [@zvgandam](https://community.sendbird.com/u/zvgandam)\
**Post date:** [October 17, 2023, 7:28am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/6 "2023-10-17T07:28:23Z")

</div>

Yes! @Tyler

In main.dart

```auto
SendbirdChat.init(appId: sendbirdAppId);

```

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [October 17, 2023, 7:35am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/7 "2023-10-17T07:35:36Z")

</div>

I guess next steps are to understand what version of Flutter SDK you’re using?

---

<div class="post-metadata">

**Author:** ![zvgandam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zvgandam/32/4590_2.png) [@zvgandam](https://community.sendbird.com/u/zvgandam)\
**Post date:** [October 17, 2023, 7:40am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/8 "2023-10-17T07:40:57Z")

</div>

@Tyler

Using this SDK version.

```auto
sendbird_chat_sdk: ^4.0.0

```

It seems that [GroupChannelCollectionHandler] is not working properly when logout and login.

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [October 17, 2023, 8:03am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/9 "2023-10-17T08:03:14Z")

</div>

Can you look at the lock file to see what version is actually installed?  
In regards to the handler, can you help me understand why you think that is relevant to this problem? The handler should have no impact over the API calls.

---

<div class="post-metadata">

**Author:** ![zvgandam](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/zvgandam/32/4590_2.png) [@zvgandam](https://community.sendbird.com/u/zvgandam)\
**Post date:** [October 17, 2023, 8:27am UTC](https://community.sendbird.com/t/no-host-specified-in-uri-error/8441/10 "2023-10-17T08:27:34Z")

</div>

@Tyler

Thanks for responding!  
The problem was elsewhere… I’m sorry!  
Thank you so much.
