0

There is issue of java.net.UnknownHostException: Unable to resolve host "URL": No address associated with hostname

Here is what I tried.

  • Turn on/off Wifi
  • Test in Mobile Network
  • Check in Postman
  • Runtime permission integrated
  • INTERNET permission is also there.

Above solutions is working fine in Android 4.4.4, 6.0, and also 7.0.

But this is not working only on 6.0.

4
  • are you sure that the problem is not device-specific? have you tried multiple 6.0 devices? Commented Jun 26, 2017 at 6:20
  • 1
    Unable to resolve host "URL": did you literally use a hostname "URL"? Commented Jun 26, 2017 at 6:20
  • @VladMatvienko Yes I tested In 3 6.0 Devices. There is same problem in all 3 6.0 devices. Commented Jun 26, 2017 at 6:22
  • @Henry. No, I use my API URL insted of "URL". Commented Jun 26, 2017 at 6:23

1 Answer 1

1

After several attemps I found unreadable characters when setting the URL at my code. Opening the source file with VIM, I found: http://this.is.an.ip<200b>/

Where <200b> is an unreadable character at my IDE (Android studio).

After the deletion of <200b> my app started running ok at Android 5/6.

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.