微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Flutter 在 iOS 中失去了与设备的连接

如何解决Flutter 在 iOS 中失去了与设备的连接

我在 android 上做了一个应用程序,现在尝试在 ios 中运行它。我收到以下错误

    Xcode build done.                                           35.2s
    Configuring the default Firebase app...
    Configured the default Firebase app __FIRAPP_DEFAULT.
    6.34.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
    6.34.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60900000 started
    6.34.0 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see ....)
    Waiting for iPhone 11 to report its views...                         4ms
    6.34.0 - [Firebase/Analytics][I-ACS025036] App Delegate Proxy is disabled
    Lost connection to device.                                              
    Syncing files to device iPhone 11...                                    
    (This is taking an unexpectedly long time.)   

我有其他运行完美的 ios 应用。

运行 Flutter doctor 显示这一点

    Flutter doctor
    Doctor summary (to see all details,run Flutter doctor -v):
    [✓] Flutter (Channel stable,1.22.4,on macOS 11.0.1 20B50 darwin-x64,locale
        en-GB)
    
    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        ! Some Android licenses not accepted.  To resolve this,run: Flutter doctor
        --android-licenses
    [✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    [!] Android Studio (version 3.1)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [✓] Connected device (1 available)

    ! Doctor found issues in 2 categories.

编辑 = 移除了 Firebase

删除了 firebase 的东西并收到了一条这样的简单消息

     Running pod install...                                              3.0s
    Running Xcode build...                                                  
    └─Compiling,linking and signing...                         9.1s
    Xcode build done.                                           35.8s
    Waiting for iPhone 11 to report its views...                         3ms
    Lost connection to device.                                              
    Syncing files to device iPhone 11...                                    
    (This is taking an unexpectedly long time.)       ⣻

知道哪里出了问题吗?

谢谢。

解决方法

您正在使用 Firebase,并且您可能忘记从 xcode 将 firebase 的 GoogleService-Info.plist 文件添加到您的 IOS 项目中。

有时您还需要在 IOS 项目中运行 pod install 来安装所需的 pod。

,

我知道我已经迟到了,但这可能是由于 Google 地图或 iOS 中的其他 API 密钥配置不当造成的。尝试在 Xcode 中运行该应用程序,您将收到更有用的错误消息。

就我而言,是缺少 Google Map API 密钥。

解决方案:

打开 AppDelegate.swift 添加 import GoogleMaps 以及其他导入 在 GeneratedPluginRegistrant.register(with: self): GMSServices.provideAPIKey("YOUR_API_KEY_HERE") where YOUR_API_KEY 上方添加以下语句将类似于 Cloud Console 中的 AIzaSyBHV....wZEIg。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。