簡體   English   中英

在 iOS 版本上使用 Bazel 構建 iOS 應用程序失敗

[英]Building iOS app with Bazel fails on iOS version

我正在學習巴澤爾。 在我的 ios_application 規則中有這一行:

minimum_os_version = "14.5"

在 my.bazelrc 中有以下幾行:

build \
  --apple_platform_type=ios \
  --xcode_version=13.4.1 \
  --ios_minimum_os=14.5 \
  --ios_simulator_device="iPhone 13" \
  --ios_simulator_version=15.5 \

當我使用 bazel build //:App 構建它時,它給了我這些錯誤,例如

ContentView.swift:11:6: error: 'ObservedObject' is only available in iOS 13.0 or newer ,就好像我正在使用低於 Z1BDF6059919204411CBDF8308 的版本進行構建一樣

知道問題可能是什么嗎?

錯誤日志:

INFO: Analyzed target //XcodeBenchmark:App (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /Users/tahabebek/BazelEd/BenchmarkProjects/XcodeBenchmark/XcodeBenchmark/Screen5/BUILD.bazel:3:14: Compiling Swift module //XcodeBenchmark/Screen5:Screen5 failed: (Exit 1): worker failed: error executing command
  (cd /private/var/tmp/_bazel_tahabebek/ea06894acf9e8d0a18b7c9fce25481e4/execroot/__main__ && \
  exec env - \
    APPLE_SDK_PLATFORM=iPhoneSimulator \
    APPLE_SDK_VERSION_OVERRIDE=15.5 \
    SWIFT_AVOID_WARNING_USING_OLD_DRIVER=1 \
    XCODE_VERSION_OVERRIDE=13.4.1.13F100 \
  bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-e5c8d72b3b04/bin/external/build_bazel_rules_swift/tools/worker/worker swiftc @bazel-out/ios-sim_arm64-min14.5-applebin_ios-ios_sim_arm64-fastbuild-ST-92fa43ee4129/bin/XcodeBenchmark/Screen5/Screen5.swiftmodule-0.params)
# Configuration: b49a82c195d775e901470b0dfb490b914790bcca5cf674a00f03b79e63478dfc
# Execution platform: @local_config_platform//:host
error: emit-module command failed with exit code 1 (use -v to see invocation)
XcodeBenchmark/Screen5/ContentView5.swift:11:6: error: 'ObservedObject' is only available in iOS 13.0 or newer
    @ObservedObject var vm: ViewModel5

使用 bazel 5.3.0 而不是 5.1.1 修復了它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM