1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Androidで、Connection to http://xxx.xxx.xxx.xxx refused が出た時の解決方法

Last updated at Posted at 2016-10-18

Androidで、Connection to http://xxx.xxx.xxx.xxx refused が出た時の解決方法

インターネットに接続するときにエラーが出た。

10-18 13:56:23.143 28696-29337/com.tonosamart.xxx D/MainActivity: http://xxx.xxx.xxx.xxx/xxx.php?rid=1
10-18 13:56:23.157 28696-29337/com.tonosamart.xxx I/System.out: org.apache.http.conn.HttpHostConnectException: Connection to http://xxx.xxx.xxx.xxx refused

なんかよくわかんないけど、permission指定忘れてる+URLがIPアドレスだと、
上記エラーが出るみたい!

    <uses-permission android:name="android.permission.INTERNET" />

ちなみに、普通はこのエラーが出る。

10-18 13:57:28.025 29661-29770/com.tonosamart.xxx D/MainActivity: http://google.com
10-18 13:57:28.035 29661-29770/com.tonosamart.xxx I/System.out: java.lang.SecurityException: Permission denied (missing INTERNET permission?)

このエラーなら、すぐわかったのに!

はまったのでメモ

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?