xcode 嵌入式二进制验证实用程序错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29611172/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:58:53  来源:igfitidea点击:

Embedded Binary Validation Utility Error

iosxcodewatchkitxcode6.3

提问by BalestraPatrick

Since yesterday Xcode is doing stupid things while trying to run my WatchKit app on my iPhone. It gives me the error:

从昨天开始,Xcode 在尝试在我的 iPhone 上运行我的 WatchKit 应用程序时正在做一些愚蠢的事情。它给了我错误:

Embedded Binary Validation utility Error

Error: warning: Is a directory

嵌入式二进制验证实用程序错误

错误:警告:是一个目录

It's not very helpful and it seems like it's complaining about provisioning profiles for my Watchkit Extension target. I think I set it up correctly by following this answer.

这不是很有帮助,而且似乎在抱怨为我的 Watchkit 扩展目标配置配置文件。我想我按照这个答案正确设置了它。

This is how I have set up my profiles. Three App IDs and six profiles (three for development and three for distribution).

这就是我设置个人资料的方式。三个 App ID 和六个配置文件(三个用于开发,三个用于分发)。

Main app:enter image description here

主要应用:在此处输入图片说明

WatchKit Extension:enter image description here

WatchKit 扩展:在此处输入图片说明

WatchKit Watch App:enter image description here

WatchKit 手表应用程序:在此处输入图片说明

采纳答案by respectTheCode

I had my custom framework linked and embedded in both the WatchKit Extension and the App. Removing the framework from General > Embedded Binaries of the WatchKit Extension fixed it for me. I did have to delete my Build folder and restart Xcode.

我将我的自定义框架链接并嵌入到 WatchKit 扩展和应用程序中。从 WatchKit 扩展的 General > Embedded Binaries 中删除框架为我修复了它。我确实必须删除我的 Build 文件夹并重新启动 Xcode。

回答by dogsgod

I have been able to resolve the issue with the correct Provisioning Profiles setup.

我已经能够通过正确的配置文件设置来解决这个问题。

With Xcode 6.2I have been able to do a development/debug build with automatic set and no extra PPs for development in the portal, but using team provisioning.
Now with Xcode 6.3I had to add 3 explicit PPsfor development in the portal and assign them in the project settings.

随着Xcode 6.2我已经能够做一个开发/调试版本自动设定,并在门户网站的发展没有多余的PPS,但使用团队配置。
现在,Xcode 6.3我必须在门户中添加3 个显式 PP用于开发,并在项目设置中分配它们。

回答by Tim Hibbard

I've been fighting this error as well. For me, sometimes it builds, sometimes it doesn't. This is how I'm currently able to archive my WatchKit app. I'm not claiming any knowledge as to why this works, just that it works for me.

我也一直在与这个错误作斗争。对我来说,有时它会建立,有时不会。这就是我目前能够存档我的 WatchKit 应用程序的方式。我并没有声称知道这为什么有效,只是它对我有用。

  1. Clean Shift-Command-K
  2. Quit Xcode
  3. Delete files in ~Library/Developer/Xcode/Derived Data
  4. Reopen Xcode and Archive
  1. 干净的 Shift-Command-K
  2. 退出 Xcode
  3. 删除 ~Library/Developer/Xcode/Derived Data 中的文件
  4. 重新打开 Xcode 和存档

回答by Hyman Dewhurst

UPDATE:I've been having this issue on another project and managed to solve it by removing spaces in my WatchKit App and Extension target names. So before my target names were APPNAME WatchKit Appand APPNAME WatchKit Extensionchanging them to APPNAMEWatchKitAppand APPNAMEWatchKitExtensionFixed everything!

更新:我在另一个项目中遇到了这个问题,并设法通过删除我的 WatchKit 应用程序和扩展目标名称中的空格来解决它。所以在我的目标名称是APPNAME WatchKit App并将APPNAME WatchKit Extension它们更改为APPNAMEWatchKitAppAPPNAMEWatchKitExtension修复所有内容之前!

ORIGINAL:Just to add my two cents I've been struggling with this issue for a few weeks now. I've narrowed it down to including CocoaPods in the project but without a more descriptive error I've got no idea why.

ORIGINAL:为了增加我的两分钱,我已经在这个问题上苦苦挣扎了几个星期了。我已经将范围缩小到在项目中包含 CocoaPods,但没有更具描述性的错误,我不知道为什么。

I know my provisioning profiles are correct as a blank project (inc a WatchKit target) archives successfully with them. There are no static libraries in my WatchKit extension so that's not the problem either..

我知道我的配置文件是正确的,因为空白项目(包括 WatchKit 目标)与它们一起成功存档。我的 WatchKit 扩展中没有静态库,所以这也不是问题。

In the end the only thing that reliably works is using xcodebuild+ xcrunin terminal to build and archive my project. This articleexplains xcode in the terminal well.

最后,唯一可靠的方法是在终端中使用xcodebuild+xcrun来构建和归档我的项目。这篇文章很好地解释了终端中的xcode。

回答by Marcin Ma?ysz

For me the only way to fix this was to remove all spaces from schema name and watch app name.

对我来说,解决这个问题的唯一方法是从架构名称和手表应用名称中删除所有空格。

To change schema name: (eg schema is "amazingapp RC")

更改架构名称:(例如架构是“amazingapp RC”)

1) Click on schema in xCode (It is where you choose device/simulator)
2) From the list choose: "edit schema"
3) When the new modal open press "duplicate schema" in left bottom corner.
4) Choose proper name without whitespaces and save.
5) Now press manage schemes and select old one.
6) Remove it by pressing "-" button

1) 单击 xCode 中的架构(您可以在此处选择设备/模拟器)
2) 从列表中选择:“编辑架构”
3) 当新模式打开时,按左下角的“复制架构”。
4) 选择没有空格的正确名称并保存。
5) 现在按管理方案并选择旧方案。
6) 按“-”键删除

Now it is time for extension name:

现在是扩展名的时候了:

1) Click on schema in xCode (It is where you choose device/simulator)
2) Choose extension schema
3) Click "edit schema"
4) Choose Archive (release) at the bottom of the left section
5) Enter a proper name without spaces in "Archive Name"
6) Close.

1)点击xCode中的schema(它是你选择设备/模拟器的地方)
2)选择扩展模式
3)点击“编辑模式”
4)选择左侧部分底部的存档(发布)
5)输入一个正确的名称而不“档案名称”中的空格
6) 关闭。

Now build->clean, build->archive and you should be good to go.

现在构建->清理,构建->归档,你应该很高兴了。

回答by Mike Manh

I followed @dogsgod's suggestions, revoked all my certs etc. started over, 6 profiles, no luck. After doing this for almost 6 hours, another team member checked it out and it worked (letting xcode fix the issues for them). Making sure that groups were turned on for all the app id's (I am using groups to share data between watchkit and main app)

我遵循了@dogsgod 的建议,撤销了我所有的证书等。重新开始,6 个配置文件,没有运气。这样做了将近 6 个小时后,另一个团队成员检查了它并且它起作用了(让 xcode 为他们解决问题)。确保为所有应用程序 ID 启用组(我使用组在 watchkit 和主应用程序之间共享数据)

So, i thought it was just my xcode.

所以,我认为这只是我的 xcode。

Then I went to git, cloned it, and then compiled it just fine.

然后我去git,克隆它,然后编译它就好了。

Perhaps everything in my gitignore got rid of whatever files were blocking me. Or perhaps because i pulled it after they committed it. It's almost just voodoo at this point, but it worked

也许我的 gitignore 中的所有内容都摆脱了阻止我的任何文件。或者也许是因为我在他们犯下它后撤回了它。在这一点上它几乎只是巫毒教,但它起作用了

回答by Dinesh Reddy Parne

In my case it turned out to be my Xcode Preferences.

就我而言,结果是我的 Xcode 首选项。

I had my DerivedData -> Advanced Settings (Build Location) set to "Custom" = "Relative to Workspace".

我将派生数据 -> 高级设置(构建位置)设置为“自定义”=“相对于工作区”。

I changed it to Unique and that made it work.

我将其更改为 Unique 并使其正常工作。

Hopefully that helps someone.

希望这可以帮助某人。

回答by mikett

EDIT: A day later I can share one more thought. While the git cloning works, the problem resurfaces after I make some changes. Which makes me wonder if the problem comes from a bad file formatting (like non unix-like EOF or similar) or just a bug in Xcode. Anyways, my workflow currently is as follows:

编辑:一天后,我可以再分享一个想法。虽然 git 克隆有效,但在我进行一些更改后问题再次出现。这让我想知道问题是否来自错误的文件格式(如非 unix-like EOF 或类似的),或者只是 Xcode 中的错误。无论如何,我目前的工作流程如下:

1) git clone to another directory
2) archive
3) if there is an error, I need to fix it, 
4) git commit & git push
5) repeat steps 1 & 2 ... 

Which is bothersome, but it's the only way I can archive my project and actually upload it to the App Store...

这很麻烦,但这是我存档项目并将其实际上传到 App Store 的唯一方法......

ORIGNAL POST:I have encountered this error as well. My project uses CocoaPods, multiple targets and build schemes as well as group entitlements. At times I can't build, although this is fixable (see below) but the problem with archiving persited for a longer time. After two days of fighting with it, my summary is as follows:

原帖:我也遇到过这个错误。我的项目使用 CocoaPods、多个目标和构建方案以及组权限。有时我无法构建,虽然这是可以修复的(见下文),但归档问题持续了更长的时间。经过两天的折腾,我总结如下:

I have followed all the responses and I can see that sometimes doing:

我已经关注了所有的回复,我可以看到有时会这样做:

1) clean project

1)清洁项目

2) (optional - not alwys needed) restart Xcode

2)(可选 - 并非总是需要)重新启动 Xcode

3) delete derived data folder contents

3)删除派生数据文件夹内容

allows me to compile and run the App. But I still can't archive. Sometimes it seems that I have to do it twice.

允许我编译和运行应用程序。但我仍然无法存档。有时似乎我必须做两次。

Apart from the above, I have tried (and failed to archive) the following suggestions:

除了上述建议之外,我还尝试了(但未能存档)以下建议:

  • rename the target names (and containing folders) to NOT include whitespaces, the Extension and WatchApp targets doesn't have whitespaces in their respective names, but the project won't archive (no change)
  • I have checked that there's no embedded binaries in the Extension Target (watchApp don't have this option)
  • I have tried changing the deployment target (default was iOS 8.3 for Xcode 6.4) to both 8.2 and 8.4 with no luck in archiving.
  • I have recreated the AppIDs and all the provisioning profiles for both "adHoc" and "release schemas", no luck either.
  • and I have verified that the current schema I'm trying to archive doesn't have whitespaces, but it still doesn't change anything.
  • I have even tried the last suggestion, i.e. changing the default Derived Data folder location but, as I have suspected, it haven't changed anything.
  • 重命名目标名称(和包含文件夹)以不包含空格,扩展和 WatchApp 目标在其各自的名称中没有空格,但项目不会存档(无更改)
  • 我检查了扩展目标中没有嵌入的二进制文件(watchApp 没有这个选项)
  • 我尝试将部署目标(Xcode 6.4 的默认为 iOS 8.3)更改为 8.2 和 8.4,但没有成功归档。
  • 我已经为“adHoc”和“release schemas”重新创建了 AppID 和所有配置文件,但也不走运。
  • 并且我已经验证我正在尝试存档的当前模式没有空格,但它仍然没有改变任何东西。
  • 我什至尝试了最后一个建议,即更改默认的派生数据文件夹位置,但正如我怀疑的那样,它没有改变任何内容。

Interestingly, what actually HAVE WORKED is the suggestion from Mike Manh: checking out the repo to another folder.

有趣的是,实际有效的是 Mike Manh 的建议:将 repo 检出到另一个文件夹

After cloning the repo to a new empty folder, everything suddenly started working. This leads me to the conclusion that there might be some leftover files/broken links/whatever in my current project folder. I guess this could've happen when I was trying to rebase my watchKit development branch into the current master branch. Which started trowing me some crazy conflicts and I have finally aborted the rebase. Possibly it was the point when the archive option ceased to function normally.

将 repo 克隆到一个新的空文件夹后,一切突然开始工作。这使我得出结论,我当前的项目文件夹中可能有一些剩余的文件/损坏的链接/任何内容。我想这可能发生在我尝试将 watchKit 开发分支重新设置为当前主分支时。这开始给我带来一些疯狂的冲突,我终于中止了 rebase。可能是存档选项停止正常运行的时候。

回答by Dmytro Nosulich

I had the same problem. In Xcode 6.* I fixed it by cleaning my DerivedData folder. But in new Xcode 7 it didn't help. So I removed spaces in WatchKit Extension and WatchKit App ("planckMailiOS WatchKit App" -> "planckMailiOSWatchKitApp" and "planckMailiOS WatchKit Extension" -> "planckMailiOSWatchKitExtension").

我有同样的问题。在 Xcode 6.* 中,我通过清理我的 DerivedData 文件夹来修复它。但是在新的 Xcode 7 中它没有帮助。所以我删除了 WatchKit Extension 和 WatchKit App 中的空格(“planckMailiOS WatchKit App”->“planckMailiOSWatchKitApp”和“planckMailiOS WatchKit Extension”->“planckMailiOSWatchKitExtension”)。