ios- Apple Mach-O 链接器错误 [重复]

Posted

技术标签:

【中文标题】ios- Apple Mach-O 链接器错误 [重复]【英文标题】:ios- Apple Mach-O Linker Error [duplicate] 【发布时间】:2017-04-11 17:38:29 【问题描述】:

所以我在我的 xCode 项目中使用了pod deintegrate,然后当我随后使用pod install 时,我收到了以下构建时错误。

我不知道为什么会发生这种情况,它在我解体之前就可以工作。 Apple Mach-O 链接器错误组

我已尝试清理项目并删除并重新添加 ViewController,这在其他答案中有所建议。没用。

  "type metadata accessor for Alamofire.Result", referenced from:

  "Alamofire.(request (Alamofire.URLConvertible, method : Alamofire.HTTPMethod, parameters : [Swift.String : Any]?, encoding : Alamofire.ParameterEncoding, headers : [Swift.String : Swift.String]?) -> Alamofire.DataRequest).(default argument 1)", referenced from:

  "Alamofire.(request (Alamofire.URLConvertible, method : Alamofire.HTTPMethod, parameters : [Swift.String : Any]?, encoding : Alamofire.ParameterEncoding, headers : [Swift.String : Swift.String]?) -> Alamofire.DataRequest).(default argument 2)", referenced from:

  "SwiftyJSON.JSON.init (Any) -> SwiftyJSON.JSON", referenced from:

  "protocol witness table for Swift.Int : SwiftyJSON.JSONSubscriptType in SwiftyJSON", referenced from:

  "SwiftyJSON.JSON.subscript.getter : ([SwiftyJSON.JSONSubscriptType]...) -> SwiftyJSON.JSON", referenced from:

  "Alamofire.Result.value.getter : A?", referenced from:

  "protocol witness table for Swift.String : Alamofire.URLConvertible in Alamofire", referenced from:

  "protocol descriptor for SwiftyJSON.JSONSubscriptType", referenced from:

  "protocol witness table for Alamofire.JSONEncoding : Alamofire.ParameterEncoding in Alamofire", referenced from:

  "SwiftyJSON.JSON.arrayValue.getter : [SwiftyJSON.JSON]", referenced from:

  "static Alamofire.JSONEncoding.default.getter : Alamofire.JSONEncoding", referenced from:

  "Alamofire.(request (Alamofire.URLConvertible, method : Alamofire.HTTPMethod, parameters : [Swift.String : Any]?, encoding : Alamofire.ParameterEncoding, headers : [Swift.String : Swift.String]?) -> Alamofire.DataRequest).(default argument 3)", referenced from:

  "type metadata for Alamofire.JSONEncoding", referenced from:

  "static SwiftyJSON.JSON.null.getter : SwiftyJSON.JSON", referenced from:

  "Alamofire.(request (Alamofire.URLConvertible, method : Alamofire.HTTPMethod, parameters : [Swift.String : Any]?, encoding : Alamofire.ParameterEncoding, headers : [Swift.String : Swift.String]?) -> Alamofire.DataRequest).(default argument 4)", referenced from:

  "Alamofire.request (Alamofire.URLConvertible, method : Alamofire.HTTPMethod, parameters : [Swift.String : Any]?, encoding : Alamofire.ParameterEncoding, headers : [Swift.String : Swift.String]?) -> Alamofire.DataRequest", referenced from:

  "type metadata for SwiftyJSON.JSON", referenced from:

  "Alamofire.DataRequest.(responseJSON (queue : __ObjC.DispatchQueue?, options : __ObjC.JSONSerialization.ReadingOptions, completionHandler : (Alamofire.DataResponse<Any>) -> ()) -> Self).(default argument 0)", referenced from:

  "protocol witness table for Swift.String : SwiftyJSON.JSONSubscriptType in SwiftyJSON", referenced from:

  "Alamofire.DataRequest.(responseJSON (queue : __ObjC.DispatchQueue?, options : __ObjC.JSONSerialization.ReadingOptions, completionHandler : (Alamofire.DataResponse<Any>) -> ()) -> Self).(default argument 1)", referenced from:

  "Alamofire.DataRequest.responseJSON (queue : __ObjC.DispatchQueue?, options : __ObjC.JSONSerialization.ReadingOptions, completionHandler : (Alamofire.DataResponse<Any>) -> ()) -> Self", referenced from:

clang: error: linker command failed with exit code 1 (use -v to see invocation)`

【问题讨论】:

calvocruz 你的框架没有正确安装。你能显示你的 pod 文件吗。 【参考方案1】:

碰巧,here 发布的答案对我有用!

在Xcode中打开Product菜单下拉并按住Option,“Clean”变成“Clean Build Folder”

【讨论】:

以上是关于ios- Apple Mach-O 链接器错误 [重复]的主要内容,如果未能解决你的问题,请参考以下文章

项目存档上的 Apple Mach-O 链接器错误

FacebookLoginSKK 4 Apple Mach-O链接器错误

带有 Swift 3 和 Xcode 9 GM 的 Apple Mach-O 链接器 (ld) 错误组

CocoaAsyncSocket Apple Mach-O 链接器错误

Apple Mach-O 链接器错误解析

如何摆脱 Apple Mach-O 链接器错误?