【问题标题】:CompileSwift normal arm64 when using `xcodebuild` to archive使用 `xcodebuild` 归档时 CompileSwift 正常 arm64
【发布时间】:2022-04-05 22:34:49
【问题描述】:

问题:存档时终端出现以下错误

The following build commands failed:

CompileSwift normal arm64

CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler

重现步骤: xcodebuild -workspace playmule.xcworkspace -scheme playmule -sdk iphoneos -archivePath ~/Desktop/playmule.xcarchive -configuration playmule archive

以下是 ** ARCHIVE FAILED ** 之前的一堆行:(见下文)

/Users/ss/Desktop/playmule-ios/playmule/Utility/NetworkManager.swift:174:25:错误:类型'Constants.Api'没有成员'BaseUrl';你是说'resetUrl'吗? 让 urlString = Constants.Api.BaseUrl + Constants.Api.currentVersion + Constants.Api.resendSMSEndpoint ^~~~~~~~~~~~~~~~~~~~~~ 重置网址

对于同一个静态变量会重复同样的错误。 该变量被确认存在于结构中,如下所示:

struct Constants {
  struct Api {
    static let BaseUrl = "https://some-valid-url.com/dev/"
  }
} 

编辑:我可以在设备和模拟器上运行这个项目。所以这个问题与代码语义无关

【问题讨论】:

  • 请在您的问题上粘贴相关的一行。
  • 更新后的帖子,只有一行。。模式相同,重复19次,但始终是同一个变量BaseUrl替换为resetUrl
  • 您确定所有花括号 {} 都正确完成。确保每个开口都关闭任何代码块。慢慢来
  • 你能在 Real Device(armv64) 中安装调试版本吗?
  • @ShahrukhAlam 是的,我可以在真机和模拟器上安装和运行它

标签: ios swift xcode xcodebuild xcarchive


【解决方案1】:

我使用-parallelizeTargets 对我的xcodebuild 命令进行了小幅调整,以解决具有框架/链接依赖目标的项目的构建错误:

xcodebuild -workspace playmule.xcworkspace -scheme playmule -sdk iphoneos -archivePath ~/Desktop/playmule.xcarchive -parallelizeTargets archive

请注意,上述标志还有助于使用 xcodebuild 编译其他操作,例如 builddocbuild

【讨论】:

    猜你喜欢
    • 2016-12-19
    • 2020-07-20
    • 1970-01-01
    • 2020-05-15
    • 1970-01-01
    • 1970-01-01
    • 2021-01-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多