ios 如何在 Xcode 7 中 ENABLE_BITCODE?

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

How to ENABLE_BITCODE in Xcode 7?

iosobjective-cxcodeparse-platformframeworks

提问by Kingofmit

I'm developing with parse.com and I get this problem upgrading to Xcode 7. Some Parse Frameworks are not fully working.

我正在使用 parse.com 进行开发,但在升级到 Xcode 7 时遇到了这个问题。一些 Parse 框架不能完全正常工作。

I've got this Warning:

我有这个警告:

URGENT: all bitcode will be dropped because '/Users/[MY_USER]/Downloads/parse-starter-project-1/ParseStarterProject/Parse.framework/Parse(PFMutableFileState.o)' was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.

紧急:所有位码都将被删除,因为 '/Users/[MY_USER]/Downloads/parse-starter-project-1/ParseStarterProject/Parse.framework/Parse(PFMutableFileState.o)' 是在没有位码的情况下构建的。您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或为此目标禁用位码。注意:这将是未来的错误。

Let me remind that everything was working in the last version of Xcode 6.

让我提醒一下,在最新版本的 Xcode 6 中一切正常。

How to ENABLE Bitcode in Xcode 7?

如何在 Xcode 7 中启用位码?

回答by Sheamus

If you are using a third-party framework or library that was updated for iOS 9, and you don't want to include bitcode, then you should check to see if a version of the framework was provided without bitcode. See Apple's noteon when to include it in your app bundle:

如果您使用的是针对 iOS 9 更新的第三方框架或库,并且您不想包含 bitcode,那么您应该检查是否提供了不带bitcode. 请参阅Apple关于何时将其包含在您的应用程序包中的说明:

For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode.

对于 iOS 应用程序,位码是默认的,但可选的。对于 watchOS 和 tvOS 应用程序,位码是必需的。如果您提供 bitcode,则应用程序包中的所有应用程序和框架(项目中的所有目标)都需要包含 bitcode。

To disable/enable bitcodein your project, follow these steps:

bitcode在您的项目中禁用/启用,请按照下列步骤操作:

  1. In the project build settings, make sure you have enabled All settings to be visible.
  2. The Build Options are the 4th section down. Select Yes or No for the Enable Bitcodeoption.
  1. 在项目构建设置中,确保您已启用所有设置可见。
  2. 构建选项位于第 4 部分。为Enable Bitcode选项选择是或否。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

回答by Bj?rn Kaiser

That would be something Parse has to do, when enabling bitcode for your app, all apps and frameworks in your bundle need to include bitcode (see here). As you can see, the Parse framework does not use this as of now, which is understandable as this is still in beta and not ready for prime-time yet.

这将是 Parse 必须做的事情,当为您的应用程序启用 bitcode 时,您包中的所有应用程序和框架都需要包含 bitcode(请参阅此处)。如您所见,Parse 框架目前还没有使用它,这是可以理解的,因为它仍处于测试阶段,尚未准备好进入黄金时段。

回答by Chris Trevarthen

This appears to now be an error in Xcode 7 beta 3. If the the Cocoapod you're using wasn't built with ENABLE_BITCODE turned on, you can try disabling it altogether by adding the following to the bottom of your Podfile:

这现在似乎是 Xcode 7 beta 3 中的错误。如果您使用的 Cocoapod 不是在启用 ENABLE_BITCODE 的情况下构建的,您可以尝试通过将以下内容添加到 Podfile 底部来完全禁用它:

post_install do |installer|

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

    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

WARNING: From what I've read, you can't submit WatchKit apps without ENABLE_BITCODE turned on, so that is a trade-off until Parse updates their pods.

警告:根据我的阅读,您无法在未打开 ENABLE_BITCODE 的情况下提交 WatchKit 应用程序,因此在 Parse 更新其 pod 之前,这是一种权衡。

回答by Pravin S.

Just Search for bitcode in Build setting and set it to false/NO

只需在 Build 设置中搜索 bitcode 并将其设置为 false/NO