Solved

React Native crashes with loss of network connectivity

  • 6 February 2023
  • 2 replies
  • 1065 views

Running a React Native app with "@amplitude/analytics-react-native": "0.8.0", an error occurs after losing network connectivity:

Amplitude Logger [Error]: TypeError: Network request failed

Wrapping the Amplitude methods with try/catch does not affect the triggering of this error, leaving me to assume it’s an issue with the SDK.  Is this a known issue or do you have any solutions that you can provide?

icon

Best answer by eddie.gaona 7 February 2023, 23:06

View original

2 replies

Userlevel 5
Badge +9

Hello @mpettit hope all is well!

 

The error being shown seems to indicate that the error is actually with access permissions to the internet. Here are a couple of links that can help depending on which platform you are seeing the error:

 

Android: https://github.com/amplitude/Amplitude-ReactNative/issues/153

iOS: https://stackoverflow.com/questions/38418998/react-native-fetch-network-request-failed

 

Hope this helps!

@eddie.gaona , thanks for the response.

The crash occurs in iOS and Android.  The access permissions are set correctly and the issue only occurs after the device loses internet connectivity.  Do you have any other suggestions?

 

Thanks!

Reply