0

I have looked through all the answers for the same problem and nothing worked for me yet, I must be missing something....I tried:

  1. http://10.0.2.2:8080
  2. http://10.0.3.2:8080
  3. http://192.168.56.1:8080 (which is my vbox 0 ip)
  4. http://192.168.172.2:8080 (which is my vbox 1 ip)

I also tried all the above without the port number (desperate) All of that didn't work

I was running Google Endpoionts on localhost, then to make the test easier, I turned on Tomcat local server and tried to hit that one instead...they both work locally i.e. (http://localhost:8080) but not from Genymotion!

I am using Genymotion Free-Version for personal use....now I am wondering, Does the free version even support localhost calls?

Update: For some mysterious reason, I can hit Tomcat from Genymotion using http://192.168.56.1:8080....but not Google Endpoint!

user -1
  • 110
  • 8

1 Answers1

1

Problem solved! This is what I did:

First Genymotion Emulator couldn't reach the localhost at all although I was using the correct address (http://192.168.56.1:8080) which is VBox-0 ip address (got that from ipconfig)....Then I went to the Virtual Box -> Settings -> Network -> and switched Adapter-1 to Bridge Adapter and selected my wifi network and then switched back...this must have re-triggered some corrupt process in the Oracle VBox that comes with Genymotion. That fixed problem 1 and now I can reach my Tomcat.

Still Google Endpoints cannot be reached via, Thanks to This Answer my problem was solved. In Module:backend build.gradle I added httpAddress = "0.0.0.0" under appengine, then synced the backend module. And on the Android App where I make the call to the backend endpoints, I changed the url from 10.0.2.2:8080 which is Android Default Emulator into .setRootUrl("http://192.168.56.1:8080/_ah/api/") That solved problem 2.

Make sure your VBox is set as follows: Adapter 1: Host-only Adapter - VirtualBox Host-only Ethernet Adapter #2 Adapter 2: Host-only Adapter - VirtualBox Host-only Ethernet Adapter (which was 192.168.56.1)

my phone ip address was also on the same network as Vbox0 i.e. (192.168.56.101)

Community
  • 1
  • 1
user -1
  • 110
  • 8