xcode 可重定位 dylib(例如嵌入式框架)仅在 iOS 8.0 及更高版本上受支持 (@rpath/libswift_stdlib_core.dylib)

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

relocatable dylibs (e.g. embedded frameworks) are only supported on iOS 8.0 and later (@rpath/libswift_stdlib_core.dylib)

iosxcodexcode6

提问by JuJoDi

I just upgraded from Xcode 6 Beta 2 to Xcode Beta 3 and am now getting the following warning when building my project:

我刚刚从 Xcode 6 Beta 2 升级到 Xcode Beta 3,现在在构建我的项目时收到以下警告:

ld: warning: relocatable dylibs (e.g. embedded frameworks) are only supported on iOS 8.0 and later (@rpath/libswift_stdlib_core.dylib)

It is a warning but seems to mean my current setup will not work on iOS 7.1, which is my deployment target. How can I track down which frameworks are embedded, and how can I fix this for iOS < 8.0?

这是一个警告,但似乎意味着我当前的设置不适用于 iOS 7.1,这是我的部署目标。如何追踪嵌入了哪些框架,以及如何针对 iOS < 8.0 解决此问题?

采纳答案by vladof81

This appears to be a bug of Beta 3. As pointed out by Apple Engineer on this post.

这似乎是 Beta 3 的一个错误。正如 Apple Engineer 在这篇文章中指出的那样。

I have also been living with this warning when running apps on iOS 7.1 device.

在 iOS 7.1 设备上运行应用程序时,我也一直忍受着这个警告。

回答by ilya n.

You see and add them on the project page when you select the target: tab General->Embedded Binaries(and they then appear in Build Phases->Embed Frameworks).

当您选择目标时,您会在项目页面上看到并添加它们:选项卡General->Embedded Binaries(然后它们出现在Build Phases->Embed Frameworks 中)。

Example of embedded frameworks

嵌入式框架示例

Embedded frameworks for OSXwere available in Xcode 5, but not for iOS.

OSX 的嵌入式框架在 Xcode 5 中可用,但不适用于 iOS

WWDC session regarding new features in Xcode 6 specifically promised dynamic frameworks for iOS 8 (someone please add citation when developer center comes back online). So far, with all Xcode 6 betas, I have had no problems compiling and debugging an app with frameworks on iOS 7.

关于 Xcode 6 中的新功能的 WWDC 会议专门承诺为 iOS 8 提供动态框架(当开发者中心重新上线时,请有人添加引文)。到目前为止,使用所有 Xcode 6 测试版,我在使用 iOS 7 框架编译和调试应用程序时没有遇到任何问题。

But since this wasn't promised, frameworks for iOS7 is something you cannot depend on(e.g. this may stop working in later betas; an app with embedded framework for iOS 7 may be rejected, etc.). That may explain why they added an explicit warning.

但是由于这没有得到承诺,iOS7 的框架是你不能依赖的(例如,这可能会在以后的测试版中停止工作;带有 iOS 7 嵌入式框架的应用程序可能会被拒绝,等等)。这可以解释为什么他们添加了明确的警告。

There's not much you can do if this feature turns out to be indeed unsupported, other than remove the frameworks from the target and use static libraries as we did with Xcode 5. Or go the iOS8-only route.

如果事实证明此功能确实不受支持,除了像我们在 Xcode 5 中所做的那样从目标中删除框架并使用静态库之外,您无能为力。或者走 iOS8-only 路线。

回答by fatshoe

After using XCode 6.1.1 I am able to put the code on iOS 8+ iOS7.1.2 and iOS 6.1.3 Although the warning is still there but the app works absolutely fine on all the 3 OSs

使用 XCode 6.1.1 后,我可以将代码放在 iOS 8+ iOS7.1.2 和 iOS 6.1.3 上虽然警告仍然存在,但该应用程序在所有 3 个操作系统上都运行良好

====================== Lucky guy... My project keeps failing to compile after I referenced the PushKit framework.

====================== 幸运的家伙...在我引用 PushKit 框架后,我的项目一直无法编译。

The project is a new project created by Xcode with only 3 new functions for testing Push Notification.

该项目是Xcode创建的一个新项目,只有3个新功能用于测试Push Notification。

The workaround is to put the PushKit framework as "embedded", but this is not a good solution since my working Xcode project will be generated from Unity3d. Making the changes manually will break the auto build process.

解决方法是将 PushKit 框架设为“嵌入式”,但这不是一个好的解决方案,因为我的工作 Xcode 项目将从 Unity3d 生成。手动进行更改将中断自动构建过程。

回答by user3812138

this is happening because one of your embedded binaries's deployment target is lower than your applications target. lower your embeded binaries's building target and be fine.

这是因为您的嵌入式二进制文件的部署目标之一低于您的应用程序目标。降低您嵌入的二进制文件的构建目标,就可以了。

this was the error cause in xcode 6.1.1

这是 xcode 6.1.1 中的错误原因

i was using xcglogger with deployment target ios 8.0, and my application's deployment target 7.0. set the xcglogger's deployment target ios 7.0 and problem solved.

我将 xcglogger 与部署目标 ios 8.0 和我的应用程序的部署目标 7.0 一起使用。将 xcglogger 的部署目标设置为 ios 7.0 并解决问题。

回答by rob

I had this error after adding a C++ framework (DeepBelief) to a project. Adding an empty .cpp file to the project fixed it.

在向项目添加 C++ 框架 (DeepBelief) 后,我遇到了这个错误。向项目添加一个空的 .cpp 文件修复了它。

I'm using Beta4, and found the answer on the DeepBelief github site:

我正在使用 Beta4,并在 DeepBelief github 站点上找到了答案:

XCode may be skipping the standard C++ library, and that's needed by the DeepBelief.framework code. One workaround I've found is to include an empty .mm or .cpp file in the project to trick XCode into treating it as a C++ project.

XCode 可能会跳过标准 C++ 库,这是 DeepBelief.framework 代码所需要的。我发现的一种解决方法是在项目中包含一个空的 .mm 或 .cpp 文件,以诱使 XCode 将其视为 C++ 项目。

回答by loretoparisi

Read this github post from ReactiveCocoa

ReactiveCocoa阅读这篇 github 帖子

The bug is still present in XCode6 GM and so XCode6 final release:

该错误仍然存​​在于 XCode6 GM 中,因此 XCode6 最终版本:

Well, I get the exact same issue in xcode6GM no matter whether I create framework for swift OR objc :-[[[[[[[[[[[[[[[

好吧,无论我是否为 swift 或 objc 创建框架,我都会在 xcode6GM 中遇到完全相同的问题:-[[[[[[[[[[[[[[[[]

According to Apple Extension Programming Guide:

根据Apple 扩展编程指南

You can make a containing app available to users running iOS 7 or earlier, but then must take precautions to safely link embedded frameworks when running in iOS 8 or later.

您可以向运行 iOS 7 或更早版本的用户提供包含应用程序,但在 iOS 8 或更高版本中运行时,必须采取预防措施以安全链接嵌入式框架。

talking about app extensions, but if you read it, you can understand that this applies to embedded frameworks in general.

谈论应用程序扩展,但如果您阅读它,您就会明白这通常适用于嵌入式框架。

回答by Ravi Dalmia

After using XCode 6.1.1 I am able to put the code on iOS 8+ iOS7.1.2 and iOS 6.1.3 Although the warning is still there but the app works absolutely fine on all the 3 OSs

使用 XCode 6.1.1 后,我可以将代码放在 iOS 8+ iOS7.1.2 和 iOS 6.1.3 上虽然警告仍然存在,但该应用程序在所有 3 个操作系统上都运行良好

Yes not able to submit the app for review. Had to do by changing the modern frameworks to Static libs.

是的,无法提交应用程序进行审核。必须通过将现代框架更改为静态库来完成。