LoginSignup
3
0

More than 3 years have passed since last update.

AndroidエミュレータのFlutterアプリ内でネットワーク接続ができない

Last updated at Posted at 2020-12-22

パーミッションとDNS

環境

macOS Big Sur バージョン11.0.1
Android Studio 4.0.1
Android Emulator 30.0.12

エラー

socketexception: failed host lookup: 'hoge.com' (os error: no address associated with hostname, errno = 7)

解決方法

アプリのパーミッション設定

android/app/src/main/AndroidManifest.xml
<manifest>下に以下を追加

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

これでもエラーが変わらなければ↓

macのDNS設定

システム環境設定>ネットワーク>Wi-Fi>詳細...>DNS
DNSサーバに8.8.8.8を追加
スクリーンショット 2020-12-16 5.51.47.png

参考

3
0
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
3
0