Skip to content

[🐛] @react-native-firebase/auth - auth/network-request-failed on Chinese Android phone. #8597

@thanhlongnguyen140499

Description

@thanhlongnguyen140499

-I'm facing an issue when using @react-native-firebase/auth with React Native CLI in a React Native app.

  • What I’m trying to do:
    Sign up or log in a user via signInWithEmailAndPassword and createUserWithEmailAndPassword

  • What happens:
    On real Android devices, the request fails with the error: auth/network-request-failed.

  • Environment:
    "@react-native-firebase/analytics": "19.0.1",
    "@react-native-firebase/app": "19.0.1",
    "@react-native-firebase/auth": "19.0.1",
    "@react-native-firebase/crashlytics": "19.0.1",
    "@react-native-firebase/messaging": "19.0.1",
    "react-native": "0.71.2",

  • Device:
    Xiaomi, Oppo.

  • What I’ve already tried:
    Installed Cloudflare (1.1.1.1) to change DNS -> it works fine.

  • Code example:

    auth()
    .signInWithEmailAndPassword(email, password)
    .then(response => {
    if (!response?.user?.emailVerified) {
    response.user.sendEmailVerification();
    setIsLoading(false);
    return;
    } else {
    handleLoginFirebase();
    }
    })
    .catch(err => {
    setIsLoading(false);
    if (err.code === 'auth/user-not-found') {
    return;
    }
    if (err.code === 'auth/wrong-password') {
    return;
    }
    if (err.code === 'auth/too-many-requests') {
    return;
    }
    if (err.code === 'auth/invalid-email') {
    return;
    }
    if (err.code === 'auth/user-disabled') {
    return;
    }
    if (err.code === 'auth/invalid-credential') {
    return;
    }
    console.log(err);
    });
    };

  • Firebase.json
    {
    "react-native": {
    "android_task_executor_maximum_pool_size": 10,
    "android_task_executor_keep_alive_seconds": 3,
    "messaging_android_notification_color": "@color/hotpink",
    "messaging_ios_foreground_presentation_options": [
    "badge",
    "sound",
    "list",
    "banner"
    ],
    "messaging_ios_auto_register_for_remote_messages": false,
    "messaging_android_notification_channel_id": "high-priority-channel",
    "crashlytics_debug_enabled": true
    }
    }

  • Logs:
    [Error: [auth/network-request-failed] A network error (such as timeout, interrupted connection or unreachable host) has occurred.]

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions