起源
昨晚 Archive 工程,開始上傳至 App Store 時,報如下錯誤:
ERROR ITMS-90705: "Launch storyboard not found. Make sure you specify the launch storyboard filename without a filename extension for the key UILaunchStoryboardName in the Info.plist."
這句話在說找不到 Launch storyboard,確認一下 UILaunchStoryboardName 的值不需要帶擴展名,然而我確定我并沒有帶擴展名。然后同事幫我檢查工程之后發現,由于 LaunchScreen.storyboard 未設置 target membership,因而在最后 Archive 出來的工程中,找不到這個文件。
囧,這個文件是從其他工程里拖出來的,于是出現了以上情況。
了解
首先了解一下 Xcode Target 這個概念:
A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. A target defines a single product; it organizes the inputs into the build system—the source files and instructions for processing those source files—required to build that product. Projects can contain one or more targets, each of which produces one product.
在一個 workspace 里面,可以包含多個 target,每一個 target 對應不同的 product。這種情況一般可以用于同一個項目的不同版本,就可以使用不同的 target 來控制。比如免費版、試用版、付費版等。他們有共用的資源在同一個 workspace 中,而這些資源,就用 target membership 來制定,他們最后需要被 build 到哪些或哪個 product 中。