【问题标题】:Moya-ObjectMapper pod error in swiftswift中的Moya-ObjectMapper pod错误
【发布时间】:2018-03-18 07:48:32
【问题描述】:
  • 我使用的是 macOsSierra 10.12.6, Xcode9, swift 3
  • 重新安装 macOS 后,我克隆了我构建的项目并运行项目,得到如下所示的错误。Value of type 'Observable' has no member 'mapObjectValue of type 'Observable' has no member 'mapArray'
  • 在我的项目中使用了 pod。 分析依赖关系 下载依赖项 使用 Alamofire (4.5.1) 使用 AlamofireObjectMapper (4.1.0) 使用 BEMCheckBox (1.4.1) 使用螺栓 (1.8.4) 使用 Cosmos (10.0.0) 使用 ExpandableCell (1.1.0) 使用 FBSDKCoreKit (4.27.0) 使用 FBSDKLoginKit (4.27.0) 使用 FBSDKShareKit (4.27.0) 使用 FacebookCore (0.2.0) 使用 FacebookLogin (0.2.0) 使用 FacebookShare (0.2.0) 使用 GTMOAuth2 (1.1.5) 使用 GTMSessionFetcher (1.1.12) 使用 GoogleSignIn (4.1.0) 使用 GoogleToolboxForMac (2.1.1) 使用 Mixpanel-swift (2.2.1) 使用 Moya (8.0.3) 使用 Moya-ObjectMapper (2.4) 使用 ObjectMapper (2.2.9) 使用 R.swift (4.0.0) 使用 R.swift.Library (4.0.0) 使用结果 (3.2.4) 使用 RxCocoa (3.6.1) 使用 RxSwift (3.6.1) 使用 SwiftGifOrigin (1.6.1) 使用 SwiftyBeaver (1.4.2) 使用 Swinject (2.0.0) 使用 SwinjectStoryboard (1.0.0) 使用 TwitterCore (3.0.1) 使用 TwitterKit (3.1.1) 生成 Pods 项目 整合客户项目 发送统计信息 豆荚安装完成! Podfile 中有 22 个依赖项,总共安装了 31 个 pod。

[!] 自动为目标zone 分配版本10.2 的平台ios,因为没有指定平台。请在您的 Podfile 中为此目标指定一个平台。见https://guides.cocoapods.org/syntax/podfile.html#platform

  • 我无法真正理解它的 pod 问题或 mac os 问题。

  • 即使我尝试创建虚拟项目并安装 Moya-ObjectMapper pod,但没有成功

感谢任何帮助。

【问题讨论】:

  • 尝试使用旧版本的 Moya pod。最新版本中有重大更改。

标签: ios swift xcode9 objectmapper moya


【解决方案1】:

您的 pod 文件中的版本似乎与 podfile.lock 中的版本不同。

Observable+ObjectMapper.swift 在 2.4 版本中被 Single+ObjectMapper 取代。

改为使用以下依赖项

pod 'Moya-ObjectMapper/RxSwift', '~> 2.3.2' 或者使用最新的 pod 'Moya-ObjectMapper/RxSwift', '~> 2.4.2'

【讨论】:

    【解决方案2】:

    您应该使用provider.rx.request() 而不仅仅是provider.request。新的变更日志包含所有重大变更列表。

    你可以得到它here

    我建议你使用 pod 'Moya', '9.0'

    【讨论】:

      猜你喜欢
      • 2017-01-12
      • 2019-03-18
      • 2016-03-28
      • 1970-01-01
      • 1970-01-01
      • 2018-02-18
      • 2017-02-23
      • 2023-03-28
      • 2019-11-05
      相关资源
      最近更新 更多