简体   繁体   English

dyld:警告:这是什么错误?

[英]dyld: warning: What is this error?

dyld: warning: could not load inserted library '/usr/local/lib/dgagent/libpreload.dylib' because no suitable image found.  Did find:
/usr/local/lib/dgagent/libpreload.dylib: mach-o, but not built for iOS simulator

I get this output to the console log as soon as I try to build and run my app on Xcode 8.一旦我尝试在 Xcode 8 上构建和运行我的应用程序,我就会将此输出发送到控制台日志。

This does not happen when I run the same app using Xcode 7. The app is fine and there are no complaints.当我使用 Xcode 7 运行同一个应用程序时不会发生这种情况。该应用程序很好,没有任何抱怨。 The app is using Swift 2.3 (legacy is set to yes in Xcode 8).该应用程序使用 Swift 2.3(旧版在 Xcode 8 中设置为 yes)。 This is frustrating because I need to test my app on the iOS 10 simulator because on my device the app isn't working properly on iOS 10 (works on iOS 9.3.5)这令人沮丧,因为我需要在 iOS 10 模拟器上测试我的应用程序,因为在我的设备上,该应用程序在 iOS 10 上无法正常工作(适用于 iOS 9.3.5)

I know the original question is quite old, but I hit the same kind of error today and noticed the OP is also blighted with the Digital Guardian (dgagent) "security" software.我知道最初的问题已经很老了,但我今天遇到了同样的错误,并注意到 OP 也受到 Digital Guardian(dgagent)“安全”软件的影响。 DG replaces various system libraries with "secure" versions that cripple the OS to enforce corporate policies about file accesses, block web sites etc. For me, the libpreload.dynlib was replaced by DG and when a new DG version got installed by IT, it only had 64-bit versions of the libraries, not 32-bit, and some old 32-bit apps like Exceed stopped working. DG 用“安全”版本替换了各种系统库,这些版本削弱了操作系统以强制执行有关文件访问、阻止网站等的公司策略。对我来说,libpreload.dynlib 被 DG 替换,当 IT 安装新的 DG 版本时,它只有 64 位版本的库,而不是 32 位,并且一些旧的 32 位应用程序(如 Exceed)停止工作。

The very first paragraph in the Xcode 8 release notes tells you: Xcode 8 发行说明中的​​第一段告诉您:

The version of Swift 2 (2.3) used in Xcode 8 is very close to the version used in Xcode 7.3.1. Xcode 8 中使用的 Swift 2 (2.3) 版本与 Xcode 7.3.1 中使用的版本非常接近。 However, it has been updated for the newer SDKs, and therefore is not compatible with Swift frameworks compiled in Xcode 7.3.1.但是,它已针对较新的 SDK 进行了更新,因此与 Xcode 7.3.1 中编译的 Swift 框架不兼容

(My italics.) (我的斜体。)

I don't know the exact reason but I got this error when I renamed my older version of Xcode from Xcode to Xcode8.2 thinking it would be easier for me to manage the different versions.我不知道确切的原因,但是当我将旧版本的 Xcode 从 Xcode 重命名为 Xcode8.2 时出现此错误,认为管理不同版本会更容易。 I renamed it back to Xcode and opened Settings > Locations and re-picked the corresponding Command Line Tools for Xcode 8.2 and the warning disappeared.我将它重命名回 Xcode 并打开 Settings > Locations 并为 Xcode 8.2 重新选择相应的命令行工具,警告消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM