I'm trying to connect to Ganache-GUI using React native (Android emualtor). This is my code:
const Web3 = require('web3');
const HDWalletProvider = require('truffle-hdwallet-provider');
const mnemonic =
'gorilla color farm divert finish swim naive profit birth build scrub various'; // 12 word mnemonic
const provider = new HDWalletProvider(mnemonic, 'http://127.0.0.1:7545');
But I'm getting the following error :
Error: Invalid Json RPC response :"Failed to connect 127.0.0.1:7545"
I have installed web3.js and trufflehdwallet in my project.
What other step have I missed? Do I need to change the setting of my android emulator regarding the port number and the host ?
Any help would be highly appreciated.