简体   繁体   English

在 iOS 版本上使用 Bazel 构建 iOS 应用程序失败

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

I am learning bazel.我正在学习巴泽尔。 In my ios_application rule there is this line:在我的 ios_application 规则中有这一行:

minimum_os_version = "14.5"

and in my.bazelrc there are these lines:在 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 \

When I build it with bazel build //:App, it gives me these errors like当我使用 bazel build //:App 构建它时,它给了我这些错误,例如

ContentView.swift:11:6: error: 'ObservedObject' is only available in iOS 13.0 or newer , as if I am building with a lower version of iOS than 13.0 ContentView.swift:11:6: error: 'ObservedObject' is only available in iOS 13.0 or newer ,就好像我正在使用低于 Z1BDF6059919204411CBDF8308 的版本进行构建一样

any idea what the problem could be?知道问题可能是什么吗?

Error log:错误日志:

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

Using bazel 5.3.0 instead of 5.1.1 fixed it.使用 bazel 5.3.0 而不是 5.1.1 修复了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM