更新到 Xcode 7 后出错

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

Error after updating to Xcode 7

xcodecordovaionic-frameworkxcode7

提问by radioaktiv

I am developing mobile app with Ionic Framework and I just received very strange error that broke my whole build.

我正在使用 Ionic Framework 开发移动应用程序,但我刚刚收到了一个非常奇怪的错误,该错误破坏了我的整个构建。

'myapp/Plugins/com.phonegap.plugins.facebookconnect/FacebookSDK.framework/FacebookSDK(FBLikeButtonBackgroundSelectedPNG.o)' does not contain 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. for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

“myapp/Plugins/com.phonegap.plugins.facebookconnect/FacebookSDK.framework/FacebookSDK(FBLikeButtonBackgroundSelectedPNG.o)”不包含位码。您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或为此目标禁用位码。对于架构 arm64 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

That happen after . It worked perfectly before upgrading to the new Xcode version 7.0. I have tried to disable the BITCODE for the project but the Facebook functionality of the APP does not work as expected.

那之后发生的。在升级到新的 Xcode 7.0 版之前,它运行良好。我试图禁用该项目的 BITCODE,但该 APP 的 Facebook 功能没有按预期工作。

EDIT

编辑

If I disable BITCODE for the project the Facebook plugin opens the browser instead of the app therefore Disabling BITCODE is not a solution in that case.

如果我为项目禁用 BITCODE,Facebook 插件会打开浏览器而不是应用程序,因此在这种情况下禁用 BITCODE 不是解决方案。

采纳答案by radioaktiv

Here is what it worked for me:

这对我有用:

I am stealing it from here : https://github.com/Wizcorp/phonegap-facebook-plugin/issues/1116

我从这里窃取它:https: //github.com/Wizcorp/phonegap-facebook-plugin/issues/1116

  1. Update the plist with steps 2 and 3 from e Facebook's iOS 9 guide
  2. Turn off the bitcode setting (you already know how to do that :smile:)
  1. 使用Facebook 的 iOS 9 指南中的步骤 2 和 3 更新 plist
  2. 关闭位码设置(你已经知道怎么做了 :smile:)

回答by Gaurav Pandey

From Xcode 7, BitCode in enable it by default. You will get this error until all apps and frameworks in your bundle doesn't include bitcode.

从 Xcode 7 开始,BitCode 在默认情况下启用它。您将收到此错误,直到您的包中的所有应用程序和框架都不包含位码。

to remove this warning you can disable this in Build Settings

要删除此警告,您可以在构建设置中禁用它

Build Settings>All>Build Options>Enable Bitcode = NOenter image description here

构建设置>全部>构建选项>启用位码=否在此处输入图片说明

回答by Paul Sturm

This is a known issue with the Facebook Plugin. There is an open ticket at https://github.com/Wizcorp/phonegap-facebook-plugin/issues/111614- I'd suggest you keep an eye on.

这是 Facebook 插件的一个已知问题。https://github.com/Wizcorp/phonegap-facebook-plugin/issues/111614 上有一张公开票- 我建议你留意一下。

As a work-around, you might try

作为一种解决方法,您可以尝试

Project > Build Settings > Build Options > Enable Bitcode = No

(found @ http://forum.ionicframework.com/t/error-after-updating-to-xcode-7/32641)

(发现@ http://forum.ionicframework.com/t/error-after-updating-to-xcode-7/32641

回答by Surezz

I too face the same problem while updating the frameworks for giving iOS9 support.

1.To change In build settings:

Enable Bitcode = "NO"

启用位码 = "NO"

Not only for your project targets, to set all of your targets including your pods(Project) targets.

2.Change the Build Architecure only:

Debug - YES

Relese - NO

调试 - 是

释放 - 否

That was fixed!

那是固定的!

回答by Christophe Fondacci

You should update your Facebook SDK. It did the trick for me as the latest Facebook SDK version supports bitcode. You don't have to upgrade to v4 as version 3.24 works perfectly.

您应该更新您的 Facebook SDK。它对我有用,因为最新的 Facebook SDK 版本支持位码。您不必升级到 v4,因为 3.24 版可以完美运行。

There are a few other steps for iOS 9 compatibility like whitelisting FB domains and authorizing FB apps.

iOS 9 兼容性还有一些其他步骤,例如将 FB 域列入白名单和授权 FB 应用程序。

The following version support bitcode and can compile with the flag set to YES:

以下版本支持位码并且可以在标志设置为 YES 的情况下进行编译:

The relevant section of the FB documentation says:

FB 文档的相关部分说:

Is bitcode supported?

v4.6 and v3.24 of the SDK supports bitcode. If you are using earlier versions, you must disable bitcode.

是否支持位码?

SDK 的 v4.6 和 v3.24 支持位码。如果您使用的是早期版本,则必须禁用位码。

All steps required to upgrade to iOS 9 (transport security / app whitelisting) can be found here: https://developers.facebook.com/docs/ios/ios9

可以在此处找到升级到 iOS 9 所需的所有步骤(传输安全/应用白名单):https: //developers.facebook.com/docs/ios/ios9

But I have to tell you that even though it compiles/link OK and uses an "integrated" Facebook login dialog, it still uses a browser as a modal view in your app. For me it is a regression from the previous Facebook app integration. I don't know whether there's a way to get the old "native" login dialog back.

但我必须告诉你,即使它编译/链接 OK 并使用“集成的”Facebook 登录对话框,它仍然使用浏览器作为应用程序中的模式视图。对我来说,这是对之前 Facebook 应用程序集成的回归。我不知道是否有办法恢复旧的“本机”登录对话框。