xcode dyld:库未加载。原因:没有找到合适的图片
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27116371/
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
dyld: Library not loaded. Reason : no suitable image found
提问by olynoise
I've looked at a bunch of answers here and none have fixed my issue.
我在这里查看了一堆答案,但没有一个解决了我的问题。
I have an Xcode workspace with a custom framework and an iOS app project. The project has been working fine until this morning, now it builds but immediately crashes:
我有一个带有自定义框架和 iOS 应用程序项目的 Xcode 工作区。直到今天早上该项目一直运行良好,现在它构建但立即崩溃:
dyld: Library not loaded: @rpath/ONCKit.framework/ONCKit
Referenced from: /private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/atero_t
Reason: no suitable image found. Did find:
/private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/Frameworks/ONCKit.framework/ONCKit: mmap() error 1 at address=0x100118000, size=0x000B8000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/Frameworks/ONCKit.framework/ONCKit
/private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/Frameworks/ONCKit.framework/ONCKit: mmap() error 1 at address=0x100280000, size=0x000B8000 segment=__TEXT in Segment::map() mapping /private/var/mobile/Containers/Bundle/Application/4DF67A3F-6255-4276-8812-8C742A363995/atero_t.app/Frameworks/ONCKit.framework/ONCKit
I've been experimenting with build settings all day and I'm just totally lost.
我一整天都在尝试构建设置,但我完全迷失了。
采纳答案by BlitzHiryu
I came across this issue today and resolved it the same way. Revoke and regenerate code signing solves this issue. But to shed some light on the "why" part of it.
我今天遇到了这个问题并以同样的方式解决了它。撤销和重新生成代码签名解决了这个问题。但要阐明它的“为什么”部分。
Apple went ahead and changed the certificate contents. To be more precise, it added a new "OU" (organizational unit) field under Subject. By revoking and regenerating the code signing, it added the missing field and the problems went away.
Apple 继续更改证书内容。更准确地说,它在主题下添加了一个新的“OU”(组织单位)字段。通过撤销和重新生成代码签名,它添加了缺失的字段,问题就消失了。
回答by Geoherna
Incase this helps anyone, none of the solutions I kept finding on the web were working for me. Pulled my hair our for 2 days, and tried everything. I revoked in-house cert, new provisioning profile, added files to embedded, etc.
如果这对任何人都有帮助,我在网上找到的所有解决方案都不适合我。拉了我的头发 2 天,并尝试了一切。我撤销了内部证书、新的配置文件、将文件添加到嵌入式等。
Could not for the life of me figure out what was wrong until I noticed that in Keychain access my Apple WWDR and iOS Distributions certs were being set to "Always Trust"
instead of "Use Systems Default". Switched my certs back to "Use Systems Defaults"
and everything went back to working as it should. I have no idea why and how this works but it did.
直到我注意到在钥匙串访问中我的 Apple WWDR 和 iOS 发行版证书被设置为"Always Trust"
而不是“使用系统默认值”之前,我终生无法弄清楚出了什么问题。将我的证书切换回"Use Systems Defaults"
,一切都恢复正常。我不知道为什么以及如何工作,但确实如此。
回答by Tarik
It turns out that Xcode cache some device specific stuff which can get mixed up if you are running your apps on multiple devices. The simple fix is to delete Xcode cache. The following command clean it up for you
事实证明,Xcode 缓存了一些特定于设备的内容,如果您在多个设备上运行应用程序,这些内容可能会混淆。简单的解决方法是删除 Xcode 缓存。以下命令为您清理它
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode
回答by Asma Zubair
Just changing the code signing profile fixed the issue. Go to Target. Then selected a different option in General->Signing->Team
只需更改代码签名配置文件即可解决问题。前往目标。然后在 General->Signing->Team 中选择一个不同的选项
回答by Ren
Well, in my case, I'm using cocoapods, and from the pod files, change:
好吧,就我而言,我使用的是 cocoapods,从 pod 文件中,更改:
target 'CoreMotionExample' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for CoreMotionExample
pod 'Firebase/Analytics'
to
到
target 'CoreMotionExample' do
# Comment the next line if you don't want to use dynamic frameworks
# use_frameworks!
# Pods for CoreMotionExample
pod 'Firebase/Analytics'
Then things begin to work... I don't know why
然后事情开始起作用了......我不知道为什么
回答by Bsl Dngl
my problem was solved by removing "use_frameworks!" and replacing it with "use_modular_headers!" in Podfile and doing pod update and pod install in terminal.
通过删除“use_frameworks!”解决了我的问题 并将其替换为“use_modular_headers!” 在 Podfile 中并在终端中执行 pod update 和 pod install。
hope this will help you as it did for me after scratching my head for a week in this problem.
希望这能帮助你,就像在这个问题上挠了一个星期后对我所做的那样。
回答by marco
Just for any other people that, like me, come across this problem more recently and are wondering where and how exactly to revoke which code signing entity (it's in Preferences > Account):
对于像我一样最近遇到这个问题的任何其他人,他们想知道在何处以及如何撤销哪个代码签名实体(在首选项> 帐户中):
Everything was working fine for me, too, in the morning. I read somewhere else about rebooting. So, before going through another lengthy signing-identities-provisioning-profiles session, I just restarted my machine. And that fixed it apparently without any further efforts needed.
对我来说,早上一切都很好。我在其他地方阅读了有关重新启动的信息。因此,在进行另一个冗长的签名身份配置配置文件会话之前,我只是重新启动了我的机器。这显然修复了它,无需任何进一步的努力。
Swift, Xcode 7.3 on OS X 10.11.4.
Swift,在 OS X 10.11.4 上为 Xcode 7.3。
回答by Mohit Tomar
Clean Xcode's derived data
清理 Xcode 的派生数据
Launch Finder > Go > Go To Folder > Paste the line below
启动 Finder > Go > Go To Folder > 粘贴下面的行
~/Library/Developer/Xcode/DerivedData
Now restart Xcode.
现在重新启动Xcode。