Xcode 无法找到 strip-frameworks.sh 目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33377027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode unable to find strip-frameworks.sh directory
提问by CodeIt
I recently update Xcode to Version 7.1, which included Swift 2.1. I installed Swift 2.1 with no troubles. After attempting to run my project, I realized that I needed to grab the latest version of Realm, since the previous version did not support Swift 2.1. I deleted the old frameworks and imported Realm 0.96.2. Whenever I run, I now get this error:
我最近将 Xcode 更新到了 7.1 版,其中包括 Swift 2.1。我安装了 Swift 2.1 没有任何问题。在尝试运行我的项目后,我意识到我需要获取最新版本的 Realm,因为以前的版本不支持 Swift 2.1。我删除了旧框架并导入了 Realm 0.96.2。每当我运行时,我现在都会收到此错误:
bash: /Users/userName/Library/Developer/Xcode/DerivedData/appName-ghiroqitgsbvfhdqxsscyokyoouz/Build/Products/Debug-iphoneos/appName.app/Frameworks/Realm.framework/strip-frameworks.sh: No such file or directory
I suspected the problem was with the script that is required if you wish to submit your app the the App Store, so I removed the Run Script Phase, added a new one, and copied the script from the Realm documentation site:
我怀疑问题在于如果您希望将应用程序提交到 App Store 所需的脚本,因此我删除了运行脚本阶段,添加了一个新的阶段,并从 Realm 文档站点复制了脚本:
bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh"
I thought that that would fix it, but it did not. I then thought that the problem may be in the Realm.framework or RealmSwift.framework files, so I removed them and re-imported them (Just in case I messed something up). Nothing changed. Does anyone know if there is a fix to this error?
我以为那会解决它,但它没有。然后我认为问题可能出在 Realm.framework 或 RealmSwift.framework 文件中,所以我删除了它们并重新导入它们(以防万一我搞砸了)。没有改变。有谁知道是否有修复此错误的方法?
Thanks! -CodeIt
谢谢!-CodeIt
回答by marius
From the error message, it seems like, you didn't added Realm.framework
and RealmSwift.framework
to the Embedded Binariespane, which you find in the Generaltab of your project, as shown below:
从错误消息来看,您似乎没有将Realm.framework
和添加RealmSwift.framework
到嵌入式二进制文件窗格中,您可以在项目的常规选项卡中找到该窗格,如下所示:
For further validation, you can check the tab Build Phases. It should look like below:
为了进一步验证,您可以检查选项卡Build Phases。它应该如下所示:
Note: Make sure that the run script phase comes afterthe Embed Frameworksphase.
注:请确保运行脚本阶段来后的嵌入框架阶段。
Why is this script needed?
为什么需要这个脚本?
The vendored frameworks are not just single executables, but actually FAT binaries which are archives of linked executables on different architectures. This includes architecture slices for arm64
and armv7
, which are necessary for deployment on the phone as well as i386
and x86_64
which are necessary for running the app in the simulator.
供应商的框架不仅是单个可执行文件,而且实际上是 FAT 二进制文件,它们是不同体系结构上链接的可执行文件的存档。这包括建筑切片arm64
和armv7
,这是必需的手机上部署以及i386
与x86_64
所必需的运行在模拟器中的应用程序。
The strip-frameworks.sh
script main responsibility is to take care of removing unnecessary slices. This reduces the final package size and is necessary for AppStore deployment because iTunes Connect rejects apps with simulator architectures.
该strip-frameworks.sh
脚本的主要职责是处理删除不必要的切片。这减少了最终包的大小,并且对于 AppStore 部署是必要的,因为 iTunes Connect 拒绝使用模拟器架构的应用程序。
More Details
更多细节
The script works on base of the build setting VALID_ARCHS
. Because that is changing the signed executable of the framework, it also needs to take care of code signing. Since introduction of bitcode, it also got further post processing as responsibility. It extracts the included *.bcsymbolmap
files from the framework bundle and places them into correct path in the *.xcarchive
.
该脚本基于构建设置工作VALID_ARCHS
。因为这会改变框架的签名可执行文件,所以它还需要处理代码签名。自从引入了bitcode,它也得到了进一步的后期处理作为责任。它*.bcsymbolmap
从框架包中提取包含的文件,并将它们放入*.xcarchive
.
The FAQ topic on Bitcode of PSPDFKithas a good explanation on what BCSymbolMaps are:
PSPDFKit 的 Bitcode 上的FAQ 主题对什么是 BCSymbolMaps有很好的解释:
A BCSymbolMap is a lot like a dSYM for bitcode. Xcode builds it as part of creating the app binary, and also for every dynamic framework. It's required for re-symbolicating function/method names to understand crashers.
BCSymbolMap 很像位码的 dSYM。Xcode 将其构建为创建应用程序二进制文件的一部分,也为每个动态框架构建。需要重新符号化函数/方法名称以理解崩溃者。