首页 > 解决方案 > fastlane 构建问题 - 路径名加倍

问题描述

刚开始使用 fastlane (v2.118.1) 并立即遇到构建问题。

这是我的 Fastfile 中的通道:

lane :beta do
  build_app(workspace: "projectname.xcworkspace", scheme: "schemename")
end

这是经过编辑的 Appfile:

app_identifier("redacted")
apple_id("redacted")    
itc_team_id("redacted")
team_id("redacted")

编辑值是有效的。构建运行并生成构建,但显示以下错误:

INFO [2019-03-25 10:56:28.23]: ------------------------------
INFO [2019-03-25 10:56:28.23]: --- Step: default_platform ---
INFO [2019-03-25 10:56:28.23]: ------------------------------
INFO [2019-03-25 10:56:28.23]: Driving the lane 'ios beta' 
INFO [2019-03-25 10:56:28.23]: -----------------------
INFO [2019-03-25 10:56:28.23]: --- Step: build_app ---
INFO [2019-03-25 10:56:28.23]: -----------------------
INFO [2019-03-25 10:56:28.28]: $ xcodebuild -showBuildSettings -workspace projectname.xcworkspace -scheme schemename
DEBUG [2019-03-25 10:56:29.63]: Parsing project file '/Users/username/Documents/somefolder/Users/username/Documents/somefolder/projectname.xcodeproj' to find selected provisioning profiles
DEBUG [2019-03-25 10:56:29.63]: Finding provision profiles for 'Release'
ERROR [2019-03-25 10:56:29.63]: Couldn't automatically detect the provisioning profile mapping
ERROR [2019-03-25 10:56:29.63]: Since Xcode 9 you need to provide an explicit mapping of what
ERROR [2019-03-25 10:56:29.63]: provisioning profile to use for each target of your app
ERROR [2019-03-25 10:56:29.63]: [Xcodeproj] Unable to open '/Users/username/Documents/somefolder/Users/username/Documents/somefolder/projectname.xcodeproj' because it doesn't exist.

注意:路径名包含两次 xcodeproj 文件的路径:'/Users/username/Documents/somefolder/Users/username/Documents/somefolder/projectname.xcodeproj'

使用 Xcode IDE 构建和归档时没有错误,我可以将构建提交到 TestFlight 而没有错误。这个问题只发生在快车道上。

如何诊断该路径在哪里加倍?

标签: iosswiftxcodefastlane

解决方案


正如在此处发布的那样,问题在于不知何故 xcworkspace 内容已损坏,并且包含 xcodeproj 文件的原始路径并标记为相对于组。我能够通过使用 TextEdit 编辑 xcworkspace/contents.xcworkspacedata 来更正路径来解决它。


推荐阅读