0

I am building an Android application using IBM Worklight. I keep getting the follow errors:

android build failed: java.net.UnknownHostException: nodename nor servname provided, or not known
Application 'WellPointMobile' with environment 'android' build finished with errors.

How can I stop these errors from appearing in Eclipse?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
AntonioMarquis
  • 135
  • 1
  • 7
  • I've seen that error quite a lot when switching networks (e.g. between WiFi networks). Try restarting Eclipse and/or your system. – Andrew Ferrier Jun 15 '15 at 14:56

1 Answers1

-1

This is not related to Worklight, but to OS X and Java.
Have you searched the error in Google?

See here: http://biomedicalontologies.com/2012/11/14/fixing-java-net-local-host-name-unknown-error-on-mac-os-x/

You can also edit your hosts file: Open Terminal and:

  1. Type hostname; copy the value.
  2. Type sudo vi /etc/hosts; type your password

    My hosts file looks like this:

    127.0.0.1 mbp-idan localhost
    255.255.255.255 broadcasthost ::1 localhost

    You should see something similar. Simply add your hostname after "127.0.0.1".

  3. Log out of the user account and log back in. The error should no longer happen in Eclipse.
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • "android build failed: java.net.UnknownHostException: nodename nor servname provided, or not known". Actually, this seems to be a fairly common error in Eclipse/MFP. – Andrew Ferrier Jun 15 '15 at 14:56
  • It's not failing because of MFP... I've seen it in the past and the error is very common. MFP is just another victim of it. The fix will help also MFP. – Idan Adar Jun 15 '15 at 14:57
  • Edit the hosts file, restart Eclipse (actually maybe sign out and back in from the user account) and it'll go away. – Idan Adar Jun 15 '15 at 14:58
  • +1, check it out here : http://stackoverflow.com/questions/6484275/what-causes-the-error-java-net-unknownhostexception – Sam Su Sep 01 '15 at 09:17