Xcode无法找到strip-frameworks.sh目录 [英] Xcode unable to find strip-frameworks.sh directory

查看:1037
本文介绍了Xcode无法找到strip-frameworks.sh目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将Xcode更新到版本7.1,其中包括Swift 2.1。我安装了Swift 2.1而没有任何麻烦。在尝试运行我的项目之后,我意识到我需要获取最新版本的Realm,因为之前的版本不支持Swift 2.1。我删除了旧框架并导入了Realm 0.96.2。每当我运行时,我现在都会收到此错误:

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:

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

我怀疑问题在于如果您希望将应用程序提交到App Store所需的脚本,所以我删除了运行脚本阶段,添加了一个新脚本,并复制了来自Realm文档站点的脚本:

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:

bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/Realm.framework/strip-frameworks.sh"

我认为那会解决它,但事实并非如此。然后我认为问题可能出在Realm.framework或RealmSwift.framework文件中,所以我删除了它们并重新导入它们(以防万一我搞砸了)。没有改变。有谁知道这个错误是否有解决方法?

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?

谢谢!
-CodeIt

Thanks! -CodeIt

推荐答案

从错误消息中看来,你没有添加 Realm.framework RealmSwift.framework 嵌入式二进制文件窗格,您可以在 General中找到它项目的标签,如下所示:

From the error message, it seems like, you didn't added Realm.framework and RealmSwift.framework to the Embedded Binaries pane, which you find in the General tab of your project, as shown below:

要进一步验证,您可以查看选项卡 Build Phases 。它应如下所示:

For further validation, you can check the tab Build Phases. It should look like below:

< img src =https://i.stack.imgur.com/LNZis.pngalt =Build Phases>

注意:确保 嵌入框架阶段之后运行脚本阶段

Note: Make sure that the run script phase comes after the Embed Frameworks phase.

销售的框架不仅仅是单个可执行文件,而且实际上是FAT二进制文件,它们是不同体系结构上链接可执行文件的存档。这包括 arm64 armv7 的架构片,这些是在手机上部署所必需的以及 i386 x86_64 这些是在模拟器中运行应用程序所必需的。

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.

strip-frameworks.sh 脚本主要负责删除不必要的切片。这减少了最终的包大小,并且是AppStore部署所必需的,因为iTunes Connect拒绝使用模拟器架构的应用程序。

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.

该脚本基于构建设置 VALID_ARCHS 。因为这正在改变框架的签名可执行文件,所以它还需要处理代码签名。自从引入bitcode以来,它还得到了进一步的后期处理作为责任。它从框架包中提取包含的 * .bcsymbolmap 文件,并将它们放入 * .xcarchive 中的正确路径。

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.

常见问题解答关于PCSDFKit的Bitcode的主题对BCSymbolMaps的内容有一个很好的解释:

The FAQ topic on Bitcode of PSPDFKit has a good explanation on what BCSymbolMaps are:


BCSymbolMap与bitcode的dSYM非常相似。 Xcode将其构建为创建应用程序二进制文件的一部分,也适用于每个动态框架。重新符号化函数/方法名称以理解crashers是必需的。

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.

这篇关于Xcode无法找到strip-frameworks.sh目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆