axios icon indicating copy to clipboard operation
axios copied to clipboard

Network error in React Native + Expo in Android 6.0

Open madsongr opened this issue 2 years ago • 7 comments

Describe the issue

I have an application in React Native using Expo where I fetch and send data using axios. Everything works fine on my new phone with Android 11 but when I try to test the app on my old smartphone with Android 6.0 I cannot fetch anything but network error.

Is there any restriction or SSL certificate issue related to this error? I also cannot load content on my Webview on Android 6.0.

Example Code

async function signIn(data: any) {

    await axios.post('https://website.com/api/login.php', {
        "email": data.email,
        "password": data.password,
    }).then(res => {

         const { data } = res;
        console.log("res data in auth =>>> " + JSON.stringify(data));

    }).catch(err => {
        console.log(err); // network error
    });
}


### Expected behavior

_No response_

### Axios Version

^1.3.4

### Adapter Version

_No response_

### Browser

_No response_

### Browser Version

_No response_

### Node.js Version

20.11.0

### OS

Windows 10

### Additional Library Versions

_No response_

### Additional context/Screenshots

_No response_

madsongr avatar Feb 06 '24 23:02 madsongr

I recently upgraded from 0.21.1 to 1.6.7 and the problem cropped up. It looks like this may have broken in 0.25.0.

hmolotsi avatar Feb 08 '24 15:02 hmolotsi

I recently upgraded from 0.21.1 to 1.6.7 and the problem cropped up. It looks like this may have broken in 0.25.0.

I upgraded but it didn't work anyway. I think it's because of the hosting SSL Certificate

madsongr avatar Feb 08 '24 17:02 madsongr

My application was working fine until today when it started to stop working on devices running Android 7.0.

  • I upgraded to axios version 1.6.7.
  • Then I reconfigured the SSL certificate at my hosting provider.

However, the app still did not work. So, my thoughts are that the device's trusted root CA set is outdated.

I finally ended up using the steps described here to temporarily fix the issue until app users upgrade their devices.

ProdByGR avatar Feb 19 '24 17:02 ProdByGR

any update on this?

peyman-hakemi avatar Feb 29 '24 10:02 peyman-hakemi

Do you guys want try xior ? It's based on fetch, liteweight, similiar axios API.

Maybe no this problem? Not sure, any feedback I would be appropriate.

suhaotian avatar Mar 04 '24 04:03 suhaotian