下午好,
我尝试在iOS上运行Flutter项目,以前在Android上成功运行过。但是,我得到一个错误:
"x86_64" is not an allowed value for option "ios-arch". Run 'flutter -h' (or 'flutter-h') for available flutter commands and options. Failed to build /Users/user123/Downloads/my_app. Command /bin/sh failed with exit code 255
我尝试了针对各种错误“命令/ bin / sh失败,退出代码为XXX”的各种解决方案。但是,他们都没有帮助。
另外,我在GitHub上检查了解决方案:https : //github.com/flutter/flutter/issues/9814。同时,我还不清楚如何将它们实现到iOS项目中。
感谢您的支持。
此致Maryna
更新:这些是命令的结果:
$ flutter run --verbose [ +53 ms] executing: [/Users/user143726/Downloads/flutter/] git rev-parse --abbrev-ref --symbolic @{u} [ +60 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ ] origin/beta [ ] executing: [/Users/user143726/Downloads/flutter/] git rev-parse --abbrev-ref HEAD [ +10 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ ] beta [ ] executing: [/Users/user143726/Downloads/flutter/] git ls-remote --get-url origin [ +8 ms] Exit code 0 from: git ls-remote --get-url origin [ ] https://github.com/flutter/flutter.git [ ] executing: [/Users/user143726/Downloads/flutter/] git log -n 1 --pretty=format:%H [ +12 ms] Exit code 0 from: git log -n 1 --pretty=format:%H [ ] 5ab9e70727d858def3a586db7fb98ee580352957 [ ] executing: [/Users/user143726/Downloads/flutter/] git log -n 1 --pretty=format:%ar [ +13 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar [ ] 3 weeks ago [ +1 ms] executing: [/Users/user143726/Downloads/flutter/] git describe --match v*.*.* --first-parent --long --tags [ +14 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags [ ] v0.8.2-0-g5ab9e7072 [ +508 ms] executing: /Users/user143726/Library/Android/sdk/platform-tools/adb devices -l [ +32 ms] Exit code 0 from: /Users/user143726/Library/Android/sdk/platform-tools/adb devices -l [ ] List of devices attached [ +8 ms] executing: idevice_id -h [ +98 ms] /usr/bin/xcrun simctl list --json devices [ +449 ms] No connected devices. [ ] Run 'flutter emulators' to list and start any available device emulators. [ ] If you expected your device to be detected, please run "flutter doctor" to diagnose [ ] potential issues, or visit https://flutter.io/setup/ for troubleshooting tips. [ +18 ms] "flutter run" took 1,014ms. #0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3) #1 RunCommand.validateCommand (package:flutter_tools/src/commands/run.dart:239:7)#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:350:11) #3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:306:33) #4 AppContext.run. (package:flutter_tools/src/base/context.dart:142:29) #5 _rootRun (dart:async/zone.dart:1124:13) #6 _CustomZone.run (dart:async/zone.dart:1021:19) #7 _runZoned (dart:async/zone.dart:1516:10) #8 runZoned (dart:async/zone.dart:1463:12) #9 AppContext.run (package:flutter_tools/src/base/context.dart:141:18) #10 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:297:20) #11 CommandRunner.runCommand (package:args/command_runner.dart:194:27) #12 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:347:21) #13 AppContext.run. (package:flutter_tools/src/base/context.dart:142:29) #14 _rootRun (dart:async/zone.dart:1124:13) #15 _CustomZone.run (dart:async/zone.dart:1021:19) #16 _runZoned (dart:async/zone.dart:1516:10) #17 runZoned (dart:async/zone.dart:1463:12) #18 AppContext.run (package:flutter_tools/src/base/context.dart:141:18) #19 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:303:19) #20 CommandRunner.run. (package:args/command_runner.dart:109:29) #21 new Future.sync (dart:async/future.dart:224:31) #22 CommandRunner.run (package:args/command_runner.dart:109:11) #23 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:211:18) #24 run. (package:flutter_tools/runner.dart:59:20) #25 AppContext.run. (package:flutter_tools/src/base/context.dart:142:29) #26 _rootRun (dart:async/zone.dart:1124:13) #27 _CustomZone.run (dart:async/zone.dart:1021:19) #28 _runZoned (dart:async/zone.dart:1516:10) #29 runZoned (dart:async/zone.dart:1463:12) #30 AppContext.run (package:flutter_tools/src/base/context.dart:141:18) #31 runInContext (package:flutter_tools/src/context_runner.dart:42:24) #32 run (package:flutter_tools/runner.dart:50:10) #33 main (package:flutter_tools/executable.dart:52:9) #34 main (file:///b/build/slave/Mac_Flutter_Packaging/build/archive/flutter/packages/fl utter_tools/bin/flutter_tools.dart:8:3) #35 _startIsolate. (dart:isolate/runtime/libisolate_patch.dart:287:32) #36 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12) $ flutter analyze Analyzing my_app... info • Unused import: 'package:my_app/main.dart' • test/widget_test.dart:10:8 • unused_import 1 issue found. (ran in 8.4s) $ flutter doctor -v [?] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en) • Flutter version 0.8.2 at /Users/user143726/Downloads/flutter • Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700 • Engine revision 58a1894a1c • Dart version 2.1.0-dev.3.1.flutter-760a9690c2 [?] Android toolchain - develop for Android devices (Android SDK 28.0.2) • Android SDK at /Users/user143726/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.2 • 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-1024-b01) • All Android licenses accepted. [?] iOS toolchain - develop for iOS devices (Xcode 10.0) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 10.0, Build version 10A255 • ios-deploy 2.0.0 • CocoaPods version 1.5.3 [?] Android Studio (version 3.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 28.0.1 • Dart plugin version 173.4700 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) [!] VS Code (version 1.27.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [!] Connected devices ! No devices available ! Doctor found issues in 2 categories.
Sanjeev Sang.. 8
经过大量尝试后,我按照以下步骤释放ipa文件:
转到您的终端:
cd your-flutter-project
颤动运行(这会将应用程序启动到您连接或打开的设备上)
现在,再次来到您的MAC终端并输入
扑扑生成apk(这将使发布apk)
对于IOS,
扑扑ios
完成任务后,您将看到文件包的路径,例如
/ Users / Sanjeev / Documents / WorkSpaceForFlutter / myapp / build / ios / iph oneos / Runner.app。
现在转到Xcode>产品>存档,您将看到以下屏幕
这是我解决我的问题的方法 命令/ bin / sh失败,退出代码为255
经过大量尝试后,我按照以下步骤释放ipa文件:
转到您的终端:
cd your-flutter-project
颤动运行(这会将应用程序启动到您连接或打开的设备上)
现在,再次来到您的MAC终端并输入
扑扑生成apk(这将使发布apk)
对于IOS,
扑扑ios
完成任务后,您将看到文件包的路径,例如
/ Users / Sanjeev / Documents / WorkSpaceForFlutter / myapp / build / ios / iph oneos / Runner.app。
现在转到Xcode>产品>存档,您将看到以下屏幕
这是我解决我的问题的方法 命令/ bin / sh失败,退出代码为255
我用以下命令解决了这个问题。
flutter clean flutter build ios
之后,我可以创建签名的版本,也可以上传到App Store。