[React Native] Torus CustomAuth Login Failing on Android - Unable to Resolve Node Hosts

When asking for help in this category, please make sure to provide the following details:

  • SDK Version: @toruslabs/customauth-react-native-sdk:4.0.1
  • Platform: React Native

Hello. I have been using Torus CustomAuth to implement web3 login in my React Native application. Everything was working fine until we received reports from Android users about login failures. Upon investigation, we confirmed that the functionality is still working properly on iOS.

Here’s my implementation: every state like clientid, verifier are just examples.

import CustomAuth from '@toruslabs/customauth-react-native-sdk';

const loginWithTorus = async () => {
  try {
    const subVerifierDetails = {
      clientId: GOOGLE_CLIENT_ID,
      typeOfLogin: 'google',
      verifier: 'google-lrc'
    };

    const result = await CustomAuth.triggerLogin({
      typeOfLogin: 'google',
      verifier: 'google-lrc',
      clientId: GOOGLE_CLIENT_ID,
    });
    
    console.log('Login success:', result);
  } catch (error) {
    console.error('Login failed:', error);
  }
};

Here’s the error we’re encountering:

[java.util.concurrent.CompletionException: ["Unable to resolve host \"torus-19.torusnode.com\": No address associated with hostname","Unable to resolve host \"torus-node.ens.domains\": No address associated with hostname","Unable to resolve host \"torus-node.matic.network\": No address associated with hostname","Unable to resolve host \"torus.zilliqa.network\": No address associated with hostname",null,"failed to connect to torus2.etherscan.com/35.186.153.219 (port 443) from /10.0.2.16 (port 52414) after 10000ms","Unable to parse TLS packet header",null,"failed to connect to torusnode.ont.io/18.141.61.194 (port 443) from /10.0.2.16 (port 43324) after 10000ms"], responses: [null,null,null,null,"Not Found - Request ID: 01JM9HF100CNRAZZTYD91BTM18",null,null,"",null]java.lang.Exception: invalid results from KeyLookup [null,null,null,null,"Not Found - Request ID: 01JM9HF100CNRAZZTYD91BTM18",null,null,"",null]] []

Could you please confirm if these URLs are still accessible and active?

Hi 김찬호! Thanks for reaching out and providing such detailed information about your issue. I understand that your login implementation with Torus CustomAuth is facing host resolution issues on Android, even though it works fine on iOS.

From the error message, it seems like there might be an issue with DNS resolution or network availability for these hostnames on certain Android devices. To help resolve this, I recommend:

  1. Network and DNS Check: Ensure the devices in question have internet access and can resolve DNS for these URLs. You might want to test the URLs on a browser within the same network to check for accessibility.

  2. Cross-Check Network Permissions: Confirm that your AndroidManifest.xml has all the necessary network permissions, such as <uses-permission android:name="android.permission.INTERNET" />.

  3. Inspect Network Configuration and Restrictions: Sometimes, specific networks may have restrictions that prevent access to certain domains, so trying a different network can help identify if this is the issue.

  4. TLS Settings: Ensure that the Android version supports the required TLS version. Some network issues stem from security protocols not supported on older Android versions.

To answer your question regarding URL accessibility, these URLs need to be checked regularly as their availability might depend on intermittent Torus node network configurations or downtime.

If after these steps the issue persists, please provide any additional debug logs or further insights into the network configuration being used. I’ll keep monitoring this until we find a resolution!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

All the suggested configurations have already been implemented, including TLS settings, network security configurations, and the required permissions in AndroidManifest.xml.

FYI I also posted an issue 504 Gatetime timeout in dev rpc - #2 by w3abot that’s related.

I think web3auth’s rpc nodes in devnet might have their DNS settings busted.

@here Can you please try again, devnet was under maintenance at that time last month?