库未加载-Alamofire [英] Library not loaded- Alamofire
问题描述
我已经被虫子困扰了几个小时。我正在使用Alamofire构建框架,并在iOS项目中对其进行测试。每当我运行项目时,都会出现此错误:
I have been plagued by a bug for hours. I am building a framework using Alamofire and am testing it in an iOS project. Whenever I run the project, I get this error:
dyld:库未加载:@ rpath / Alamofire.framework / Alamofire
引用自:/Users/theodorestrauss/Library/Developer/Xcode/DerivedData/TGClient-ecnnvvvxipoufihfghkpxlfccyoc/Build/Products/Debug-iphonesimulator/TGClient.framework/TGClient
原因:找不到图像
dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /Users/theodorestrauss/Library/Developer/Xcode/DerivedData/TGClient-ecnnvvvxipoufihfghkpxlfccyoc/Build/Products/Debug-iphonesimulator/TGClient.framework/TGClient Reason: image not found
我在网上搜索了GitHub问题,Stack文章等。我已经清理,删除了派生数据,从嵌入式二进制文件中添加和删除了框架等。
I have scoured the web looking at GitHub issues, Stack articles, and more. I've cleaned, deleted Derived Data, added and deleted frameworks from embedded binaries, etc.
对于那里的任何人来说,这不是重复的。其他所有问题和答案都已过时。
如果有人可以提供帮助,我将非常感谢。非常感谢。干杯,
If anyone can help, I'd immensely appreciate it. Thanks so much in advance. Cheers,
Theo
推荐答案
使用时出现此错误 Alamofire 4.5 +迦太基
,我在构建阶段将框架添加为链接库,该应用在启动时崩溃。在 XCode 9.1
中,我找不到嵌入式框架选项,因此我添加了一个运行脚本以从Carthage复制框架,然后它开始工作。
所以基本上这样
I was getting this error while using Alamofire 4.5 + carthage
, I added the framework as Linked Libraries in the build phase, the app was crashing on start. In XCode 9.1
I couldn't find the option of Embedded framework, so I added a Run Script to copy framework from Carthage and it started working.
So basically this
- 像往常一样将框架添加到构建阶段。
- 添加以下运行脚本
/ usr / local / bin / carthage copy-frameworks
/usr/local/bin/carthage copy-frameworks
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
这篇关于库未加载-Alamofire的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!