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.

编辑=删除了火球

我去掉了防火区的东西,得到了一条像这样的简单消息

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 Map或iOS中的其他API密钥配置不当造成的。尝试在Xcode中运行该应用程序,您会收到一条更有用的错误消息。

在我的情况下,它是一个谷歌地图API密钥丢失。

解决方案:

打开AppDelegate.swift将import GoogleMaps与其他导入一起添加将以下语句添加到GeneratedPluginRegistrant.register(with: self): GMSServices.provideAPIKey("YOUR_API_KEY_HERE") whereYOUR_API_KEY的上面将类似于AIzaSyBHV。。。。wZEIg。

您可能正在创建FlutterFire文档中描述的辅助应用程序。https://firebase.flutter.dev/docs/core/usage/

Secondary应用程序刚刚在Android环境中为我工作。我找到了一个从以前创建的加载选项的解决方法。通过这种方式,它在内部监督办公室发挥了作用。

类似这样的东西:

// Uses the default GoogleService-Info.plist
final Future<FirebaseApp> _firebaseDefaultApp = Firebase.initializeApp();
List<FirebaseApp> apps = Firebase.apps;
_firebaseSecondaryApp = Firebase.initializeApp(name: "SecondaryApp", options: apps[0].options);

最新更新