Xcode - 错误 ITMS-90635 - 捆绑中无效的 Mach-O - 提交到 App Store

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

Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store

iosxcode

提问by Nuno Gon?alves

I just got this error when submitting an app to the app store.

我刚刚在向应用商店提交应用时收到此错误。

enter image description here

在此处输入图片说明

Does this mean I need to set ENABLE_BITCODE for all dependencies? I tried that but then got errors saying the dependencies were not compatible with bitcode (or something like that)...

这是否意味着我需要为所有依赖项设置 ENABLE_BITCODE?我试过了,但后来出现错误,说依赖项与位码(或类似的东西)不兼容......

采纳答案by Guillaume L.

I had the same problem earlier this morning. In fact the answer is in the error : "Verify that all of the targets for a platform have a consistent value for the ENABLE_BITCODE build settings"

今天早上早些时候我遇到了同样的问题。事实上,答案就在错误中:“验证平台的所有目标对于 ENABLE_BITCODE 构建设置是否具有一致的值”

I had a target (with ENABLE_BITCODE set to NO), using multiple pods having ENABLE_BITCODE set to YES. So, all I had to, do is set ENABLE_BITCODE to YES in my project target. But I guess you have a choice, you can also set ENABLE_BITCODE to NO in all the libs your are using.

我有一个目标(ENABLE_BITCODE 设置为 NO),使用多个将 ENABLE_BITCODE 设置为 YES 的 Pod。所以,我所要做的就是在我的项目目标中将 ENABLE_BITCODE 设置为 YES。但我想你有一个选择,你也可以在你使用的所有库中将 ENABLE_BITCODE 设置为 NO。

回答by Mike Sprague

The easiest and most common fix:

最简单和最常见的修复方法:

You can uncheck "Include Bitcode" when submitting the app via Xcode. uncheck the box

通过 Xcode 提交应用程序时,您可以取消选中“包含位码”。 取消选中该框

If you use xcodebuild, you can use pass an exportOptionsPlistwith the value of uploadBitcodeset to false. In my case, we're using xctoolto build the app and don't have the ability to pass an exportOptionsPlist, so we had to remove bitcode from all of our frameworks.

如果使用xcodebuild,则可以使用传递一个值为false的exportOptionsPlistuploadBitcode。就我而言,我们使用xctool来构建应用程序,但无法传递exportOptionsPlist,因此我们必须从所有框架中删除位代码。



If anyone is using cocoapods and wants to disable bitcode for their frameworks, you can just add the following to your podfile:

如果有人正在使用 cocoapods 并希望为他们的框架禁用位代码,您只需将以下内容添加到您的 podfile 中:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Via https://stackoverflow.com/a/32685434/1417922

通过https://stackoverflow.com/a/32685434/1417922



To add a little more clarification as to what's going on with this issue:

要进一步说明此问题的发生情况:

It seems that apple just started enforcing this yesterday. If your main binary has bitcode disabled, but you include a static library or framework that has bitcode enabled, it will fail validation. It goes the other way too: if your main binary has bitcode enabled, but you include a library/framework that has bitcode disabled, it will fail validation.

似乎苹果昨天才开始执行此操作。如果您的主二进制文件禁用了位码,但您包含启用了位码的静态库或框架,则验证将失败。反之亦然:如果您的主二进制文件启用了位代码,但您包含禁用了位代码的库/框架,则验证将失败。

I had a few dependencies from GoogleMaps and Amazon that made it non trivial to switch everything to enable bitcode, so I simply disabled it and removed bitcode from one static library I had imported in my project. You can strip bitcode from any binary by using this following command

我有一些来自 GoogleMaps 和 Amazon 的依赖项,这使得切换所有内容以启用 bitcode 变得非常重要,因此我只是将其禁用并从我在项目中导入的一个静态库中删除了 bitcode。您可以使用以下命令从任何二进制文件中剥离位码

$ xcrun bitcode_strip -r {Framework}.dylib -o tmp.dylib
$ mv tmp.dylib {Framework}.dylib

https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html

https://developer.apple.com/library/content/documentation/Xcode/Conceptual/RN-Xcode-Archive/Chapters/xc7_release_notes.html

While the above are solutions to the problem, I don't agree that if the main binary has bitcode disabled that all of the included binaries should need it as well. Bitcode is just some IR code that Apple can use for app thinning--why don't they just strip it from other binaries (which I assume is what they previously did)? This doesn't make a ton of sense to me.

虽然以上是问题的解决方案,但我不同意如果主二进制文件禁用了位码,那么所有包含的二进制文件也应该需要它。Bitcode 只是 Apple 可用于应用程序精简的一些 IR 代码——为什么他们不直接从其他二进制文件中剥离它(我认为这是他们以前所做的)?这对我来说没有多大意义。

Apple thread https://forums.developer.apple.com/thread/48071

苹果线程https://forums.developer.apple.com/thread/48071

回答by Yestay Muratov

I just unchecked "include bitcode" and it started to upload

我只是取消选中“包含位码”并开始上传

回答by Dimuth Lasantha

For Carthage

对于迦太基

  1. Open your libraries in your project folder (Carthage->Checkouts->[lib name])
  2. Then open each lib in Xcode
  3. Set Enable Bitcode - No in build settings enter image description here
  4. Do it for each lib in your list
  5. Build carthage carthage build --platform xxx
  1. 在您的项目文件夹中打开您的库(Carthage->Checkouts->[lib name])
  2. 然后在Xcode中打开每个库
  3. 设置启用位码 - 在构建设置中否 在此处输入图片说明
  4. 为列表中的每个库执行此操作
  5. 建造迦太基 carthage build --platform xxx

Then you can archive and submit to the Appstore successfully

然后就可以存档并成功提交到Appstore

回答by Swapnil

We were getting same error "Xcode - Error ITMS-90635 - Invalid Mach-O in bundle - submitting to App store" from last friday (3-june-2016) .. used the below mentioned 2 steps to get this done

从上周五(2016 年 6 月 3 日)起,我们收到了相同的错误“Xcode - 错误 ITMS-90635 - 捆绑中的无效 Mach-O - 提交到 App Store”.. 使用下面提到的 2 个步骤来完成这项工作

Step 1:
Added code to pod file to mark 'ENABLE_BITCODE' = 'NO'in pods

第1步:
添加代码荚文件标记'ENABLE_BITCODE' = 'NO'豆荚

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Step 2:
Marked 'ENABLE_BITCODE' = 'NO'in pods for the project

第 2 步:在项目的 pod 中
标记'ENABLE_BITCODE' = 'NO'

Note: Tried with marking 'ENABLE_BITCODE' = 'YES'in pods and in my project too but as we are using twillio framework for calling which has a flag -read_only_relocswhich does not allow compilation with 'ENABLE_BITCODE' = 'YES'. So if your app does not use any of such framework with -read_only_relocsthen you can proceed with making 'ENABLE_BITCODE' = 'YES'as it will be good for your app.

注意:尝试'ENABLE_BITCODE' = 'YES'在 pods 和我的项目中进行标记,但因为我们使用 twillio 框架进行调用,该框架具有-read_only_relocs不允许使用'ENABLE_BITCODE' = 'YES'. 因此,如果您的应用程序不使用任何此类框架,-read_only_relocs那么您可以继续制作,'ENABLE_BITCODE' = 'YES'因为它对您的应用程序有好处。

回答by iuriimoz

I had the same issue with project "ENABLE_BITCODE = YES" and dependencies "ENABLE_BITCODE = YES" on my CI with Xcode 7.3. Solution was updating Xcode to latest available version (7.3.1)

我在使用 Xcode 7.3 的 CI 上对项目“ENABLE_BITCODE = YES”和依赖项“ENABLE_BITCODE = YES”有同样的问题。解决方案是将 Xcode 更新到最新的可用版本 (7.3.1)

回答by Thiha Aung

For those who are having build error after setting "Enable BitCode" to Yes. I have to update all the library.But,the easiest part is I use Cocoapods.So,please update all your pod project : (One by one) or All

对于那些在将“Enable BitCode”设置为 Yes 后出现构建错误的人。我必须更新所有库。但是,最简单的部分是我使用 Cocoapods。所以,请更新您所有的 pod 项目:(一一)或全部

Then set Enable BitCode to "No" before you archive.

然后在存档之前将启用 BitCode 设置为“否”。

Then Archive>>Upload>>It will pass this error.

然后存档>>上传>>它会通过这个错误。

Cheers.

干杯。