问题是,我尝试为Flutter应用程序构建iOS版本,但崩溃了,我搜索了有关错误的结果,但没有发现希望有人能提供帮助的地方。
注意:该应用程序可以启动,并且可以在IOS和Android上完美运行,但不能在其中任何一个上构建。这是我有关Android问题的文章: Android帖子
您可以在下面找到“ flutter doctor -v”和“ flutter build ios -v”的结果。
颤抖的医生-v:
[✓] Flutter (Channel stable, v1.9.1+hotfix.5, on Mac OS X 10.15 19A602, locale en-FR)
• Flutter version 1.9.1+hotfix.5 at /Users/axel/flutter
• Framework revision 1aedbb1835 (4 days ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at /Users/axel/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.1, Build version 11A1027
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
[✓] Connected device (2 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10
(API 29) (emulator)
• iPhone 11 Pro • DB06E423-957F-41AA-99D0-05735D90C30B • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-1 (simulator)
• No issues found!
Flutter构建ios -v:
[ +118 ms] "flutter ios" took 19,172ms.
Encountered error while building for device.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 BuildIOSCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:94:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:490:18)
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#4 _rootRunUnary (dart:async/zone.dart:1132:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#9 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#10 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#11 _rootRun (dart:async/zone.dart:1124:13)
#12 _CustomZone.run (dart:async/zone.dart:1021:19)
#13 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#14 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#15 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#17 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#18 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
答案 0 :(得分:0)
好吧,我发现了问题,首先我没有使用稳定的flutter版本,而我使用的是1.10.x,然后又回到了flutter 1.9.x-prefix.x,使其再次运行,但是构建失败了。再者,导致构建崩溃的是使用最新的xCode版本,并且由于我正在使用Firebase云消息传递,因此我需要在flutter应用程序的xCode部分中重新添加移动设备。 – Axel Frau刚刚编辑删除 我遵循了本教程:Firebase Cloud messaging来执行此操作,就像在我正在研究的其他项目上一样。