我开发了一个Flutter应用程序。在模拟器上运行良好。当我尝试在物理设备(iPhone 14)上启动它时,应用程序启动并工作正常。但是,当我拔下iPhone并试图重新启动应用程序时,它立即崩溃。
当我在模拟器中启动应用程序时,我没有任何警告,但当我将其启动到设备时,我有以下内容:
Runner[2706:915965] 10.7.0 - [FirebaseCore][I-COR000005] No app has been configured yet.
[TraitCollection] Class CKBrowserSwitcherViewController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.
关于Firebase,这很奇怪,因为它在初始化后在main.dart中初始化
WidgetsFlutterBinding.ensureInitialized();
我还删除了GoogleService-Info.plist文件,并通过Xcode直接添加了它,但这并没有使消息消失。
我把Xcode中的Scheme改成了Release而不是Debug,就像在一个类似问题的答案中读到的那样,但这并没有解决问题。
我的Xcode版本是最新的(14.3.1)和Flutter医生给出
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.11, on macOS 13.4.1 22F82 darwin-arm64, locale fr-BE)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Connected device (4 available)
! Error: Apple Watch de Bernard needs to connect to determine its availability. Check the connection between the device and its companion iPhone, and the connection between
the iPhone and Xcode. Both devices may also need to be restarted and unlocked. (code 1)
[✓] HTTP Host Availability
• No issues found!
我不知道该怎么办
谢谢你的帮助!
1条答案
按热度按时间qacovj5a1#
“这不是一个bug,这是一个功能。拔下iPhone时无法运行debug。您可以改为运行release。结帐参考: