# iceConnectionState goes from  \*checking\*  to  \*failed\*

**URL:** <https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612>\
**Category:** Android\
**Created:** [April 20, 2020, 5:41am UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612 "2020-04-20T05:41:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulb](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rahulb](https://react-native-webrtc.discourse.group/u/rahulb)\
**Post date:** [April 20, 2020, 5:41am UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/1 "2020-04-20T05:41:31Z")

</div>

Both clients connect to the signalling server on the phone and exchange the offer, answer and ICE candidates, but then the iceConnectionState goes from _checking_ to _failed_ and the streams don’t get exchanged.

---

<div class="post-metadata">

**Author:** ![tiffanym19](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@tiffanym19](https://react-native-webrtc.discourse.group/u/tiffanym19)\
**Post date:** [June 3, 2020, 10:54am UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/2 "2020-06-03T10:54:15Z")

</div>

Me too Im having this issue as well did you get some solution?

---

<div class="post-metadata">

**Author:** ![amjadbouhouch](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/amjadbouhouch/32/621_2.png) [@amjadbouhouch](https://react-native-webrtc.discourse.group/u/amjadbouhouch)\
**Post date:** [June 11, 2022, 10:22pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/3 "2022-06-11T22:22:26Z")

</div>

@tiffanym19 @rahulb any update?  
I’m facing the same issue.

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [June 16, 2022, 1:07pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/4 "2022-06-16T13:07:43Z")

</div>

Check that the STUN and TURN servers are functioning correctly.  
Also make sure you have both.

---

<div class="post-metadata">

**Author:** ![tufik2](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/tufik2/32/624_2.png) [@tufik2](https://react-native-webrtc.discourse.group/u/tufik2)\
**Post date:** [June 20, 2022, 1:45pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/5 "2022-06-20T13:45:11Z")

</div>

Any solution for this issue? I am having the same issue in Android Simulator, trying connecting with other Peer using the web (Chrome), but no matter what I tried, the always status keeps checking \> fail… I just need to use DataChannel so my configuration is…

I am using peerConstraints = {iceServers: [{urls: ‘stun:stun.l.google.com:19302’}]};  
and offerConstraints = {offerToReceiveAudio: false, offerToReceiveVideo: false};

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [June 20, 2022, 2:28pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/6 "2022-06-20T14:28:27Z")

</div>

Responded over [here](https://github.com/react-native-webrtc/react-native-webrtc/issues/1163#issuecomment-1160513611).  
For future reference.

---

<div class="post-metadata">

**Author:** ![tufik2](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/tufik2/32/624_2.png) [@tufik2](https://react-native-webrtc.discourse.group/u/tufik2)\
**Post date:** [June 21, 2022, 2:03pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/7 "2022-06-21T14:03:50Z")

</div>

In the repo, they said I have to set both STUN and TURN server, do you have some example of how to config it correctly… I am using the next config but the same error, my react-native app can’t reach the web app… This is the web version [https://transpher.xyz/](https://transpher.xyz/) if you want to check it… between webs are working well, but I also want to give support to Android TV for that reason I am creating a react-native app… Thanks…

```auto
peerConstraints = {iceServers: [
            { url: 'stun:stun.l.google.com:19302' },
            { url: 'stun:stun1.l.google.com:19302' },
            { url: 'stun:stun2.l.google.com:19302' },
            { url: 'stun:stun3.l.google.com:19302' },
            { url: 'turn:numb.viagenie.ca', credential: 'muazkh', username: 'webrtc@live.com' },
            { url: 'turn:relay.backups.cz', credential: 'webrtc', username: 'webrtc' },
            { url: 'turn:relay.backups.cz?transport=tcp', credential: 'webrtc', username: 'webrtc' },
            { url: 'turn:192.158.29.39:3478?transport=udp', credential: 'JZEOEt2V3Qb0y27GRntt2u2PAYA=', username: '28224511:1379330808' },
        ]
    };

```

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [June 21, 2022, 2:32pm UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/8 "2022-06-21T14:32:12Z")

</div>

Might want to redact the TURN server credentials and also change them to prevent abuse.  
Also please refer to [here](https://github.com/react-native-webrtc/react-native-webrtc/blob/16cff1523da457dbcc27bb0744ee2bad3a987c41/Documentation/BasicUsage.md#defining-peer-constraints).  
You should be using urls instead of url.

As for Android TV… i’m not entirely sure about how well that is supported.  
If you can provide logs then that might help debug.

---

<div class="post-metadata">

**Author:** ![ayushk9799](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/ayushk9799/32/758_2.png) [@ayushk9799](https://react-native-webrtc.discourse.group/u/ayushk9799)\
**Post date:** [September 26, 2023, 2:44am UTC](https://react-native-webrtc.discourse.group/t/iceconnectionstate-goes-from-checking-to-failed/612/9 "2023-09-26T02:44:17Z")

</div>

Faced the same issue …so my setup was something like this …a react native app with react native webrtc on it (client 1) and a desktop client with web rtc …both connected with server on local system… the desktop client was connected with the wifi of mobile(same mobile of client 1) and it was not working …but when i changed the router of both mobile and desktop to another router …state was connected .  
I dont want to use turn server .
