Ethereum-Android-Intro icon indicating copy to clipboard operation
Ethereum-Android-Intro copied to clipboard

Unable to connect to Ethereum Node

Open kuabhish opened this issue 4 years ago • 0 comments

        System.out.println("7");
//        toastAsync("Connecting to Ethereum network...");
        // FIXME: Add your own API key here
        web3 = Web3j.build(new HttpService("https://kovan.infura.io/v3/75ef71603d6041bd9a259a4748404bd5"));
        System.out.println("8");
        try {
            Web3ClientVersion clientVersion = web3.web3ClientVersion().sendAsync().get();
//            Web3ClientVersion clientVersion = web3.web3ClientVersion().send();
            System.out.println("9");
            if(!clientVersion.hasError()){
                System.out.println("10");
                toastAsync("Connected!");
            }
            else {
                System.out.println("11");
                toastAsync(clientVersion.getError().getMessage());
            }
        } catch (Exception e) {
            System.out.println("12");
            System.out.println(e.getMessage());
            toastAsync(e.getMessage());
        }

Hello,

I am getting error here.

Error:

I/System.out: 7
I/System.out: 8
I/System.out: 12
    java.net.UnknownHostException: Unable to resolve host "kovan.infura.io": No address associated with hostname

Please help.

kuabhish avatar Apr 11 '20 09:04 kuabhish