【问题标题】:Carthage Symbol not found when try Alamofire尝试 Alamofire 时找不到迦太基符号
【发布时间】:2020-01-25 17:33:48
【问题描述】:

我正在尝试Carthage,我认为raywenderlich 的博客文章一开始就很棒。所以我下载了启动项目,然后设置我的Carthage 设置,我将Alamofire.frameworkAlamofireImage.framework 文件拖放到Frameworks, Libraries and Embedded Content。然后我添加run script,即/usr/local/bin/carthage copy-frameworks,然后添加输入文件作为框架的路径。

$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework
$(SRCROOT)/Carthage/Build/iOS/AlamofireImage.framework

当我清理并运行项目时,它会停留在

dyld: Symbol not found: _$s9Alamofire14SessionManagerCN
  Referenced from: /Users/fiyuu/Library/Developer/CoreSimulator/Devices/E42E9DED-5A99-44C8-A0EB-0FF765CB8FB3/data/Containers/Bundle/Application/C102F9B5-402A-40F3-A450-B0D420A7722D/DuckDuckDefine.app/Frameworks/AlamofireImage.framework/AlamofireImage
  Expected in: /Users/fiyuu/Library/Developer/CoreSimulator/Devices/E42E9DED-5A99-44C8-A0EB-0FF765CB8FB3/data/Containers/Bundle/Application/C102F9B5-402A-40F3-A450-B0D420A7722D/DuckDuckDefine.app/Frameworks/Alamofire.framework/Alamofire
 in /Users/fiyuu/Library/Developer/CoreSimulator/Devices/E42E9DED-5A99-44C8-A0EB-0FF765CB8FB3/data/Containers/Bundle/Application/C102F9B5-402A-40F3-A450-B0D420A7722D/DuckDuckDefine.app/Frameworks/AlamofireImage.framework/AlamofireImage

即使我不导入也不使用Alamofire,它也会失败。

然后我尝试通过其他问题解决这个问题,在this link 中,它认为必须添加Foundation.framework。所以我尝试了它,但对这个问题没有影响。

Xcode Version: Version 11.0 (11A420a)

那么你对这个问题有什么想法吗?也许我必须为构建或其他东西添加额外的标志?并且Referenced from library 和Expected in 似乎安装不成功,是否可以通过重新构建框架来解决?

谢谢

【问题讨论】:

    标签: swift alamofire carthage alamofireimage


    【解决方案1】:

    我通过使用 Alamofire 依赖项解决了我的问题,而没有在 Cartfile 中指定任何目标或版本。

    错误发生在github "Alamofire/Alamofire" "5.0.0-rc.2" 行中,在新的Alamofire 中,您可以将它与AF.request(...) 一起使用,并且此版本无法为我成功生成框架。

    所以我只用github "Alamofire/Alamofire" 更改了行,然后更新了我的Carthage,所以它对我很有效。

    【讨论】:

      猜你喜欢
      • 2016-03-23
      • 1970-01-01
      • 2016-01-04
      • 1970-01-01
      • 1970-01-01
      • 2017-07-07
      • 2020-07-07
      • 2018-03-31
      • 2018-04-27
      相关资源
      最近更新 更多