【问题标题】:SocketException: Failed host lookup: ‘....co’ (OS Error: nodename nor servname provided, or not known, errno = 8)SocketException:主机查找失败:'..co'(操作系统错误:提供节点名或服务名,或未知,errno = 8)
【发布时间】:2019-07-12 21:23:06
【问题描述】:

在应用启动时,我收到此错误:SocketException: Failed host lookup: ‘....co’ (OS Error: nodename nor servname provided, or not known, errno = 8)

我的颤振医生 -v 输出也是:

Heyabs-MacBook-Pro:flutterLoginApp-master4OK heyab$ flutter doctor -v
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.13.6 17G65, locale en-GB)
    • Flutter version 1.0.0 at /Users/heyab/flutter
    • Framework revision 5391447fae (3 months ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/heyab/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.23.0

[✓] Connected device (1 available)
    • Heyab's iPhone • 77afb908fc6c490d3fca62cdde9a74ab4e45b4f0 • ios • iOS 11.4.1

• No issues found!

【问题讨论】:

    标签: dart flutter


    【解决方案1】:

    我收到此错误是因为我的设备处于离线状态。一旦我将我的设备设置为在线,错误就没有持续存在。

    【讨论】:

    • 你是指物理设备吗?
    【解决方案2】:
    1. 无论是手机还是模拟器,请确保您在线
    2. 确保您已在应用的 android/app/src/main/AndroidManifest.xml 中授予 Internet 权限

    【讨论】:

      猜你喜欢
      • 2021-05-09
      • 2021-04-29
      • 1970-01-01
      • 1970-01-01
      • 2019-01-05
      • 2017-04-18
      • 2020-08-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多