简体   繁体   中英

java.net.SocketTimeoutException: failed to connect to /10.0.2.2 (port 443) from /10.0.2.15 (port 43794) after 2000ms

I'm trying to write a program in the android studio. I'm shooting the database with the webservice rest api. But I get this error, I couldn't log in. enter image description here

enter image description here

on your okhttp client builder the connection timeout is 3 second, also make sure you are adding internet permission to the manifest file,

  • cleartextTrafficPermitted=false on manifest file.
  • if you are running the web service from the local servers like wamp or xxamp make sure to add all configurations required check this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM