Search code examples
iosswiftxcode9objectmappermoya

Moya-ObjectMapper pod error in swift


  • I am using the macOsSierra 10.12.6, Xcode9, swift 3
  • After reinstalling the macOS I cloned my project i built and run the project getting the Error as shown below.Value of type 'Observable' has no member 'mapObjectValue of type 'Observable' has no member 'mapArray'
  • In my project pods used. Analyzing dependencies Downloading dependencies Using Alamofire (4.5.1) Using AlamofireObjectMapper (4.1.0) Using BEMCheckBox (1.4.1) Using Bolts (1.8.4) Using Cosmos (10.0.0) Using ExpandableCell (1.1.0) Using FBSDKCoreKit (4.27.0) Using FBSDKLoginKit (4.27.0) Using FBSDKShareKit (4.27.0) Using FacebookCore (0.2.0) Using FacebookLogin (0.2.0) Using FacebookShare (0.2.0) Using GTMOAuth2 (1.1.5) Using GTMSessionFetcher (1.1.12) Using GoogleSignIn (4.1.0) Using GoogleToolboxForMac (2.1.1) Using Mixpanel-swift (2.2.1) Using Moya (8.0.3) Using Moya-ObjectMapper (2.4) Using ObjectMapper (2.2.9) Using R.swift (4.0.0) Using R.swift.Library (4.0.0) Using Result (3.2.4) Using RxCocoa (3.6.1) Using RxSwift (3.6.1) Using SwiftGifOrigin (1.6.1) Using SwiftyBeaver (1.4.2) Using Swinject (2.0.0) Using SwinjectStoryboard (1.0.0) Using TwitterCore (3.0.1) Using TwitterKit (3.1.1) Generating Pods project Integrating client project Sending stats Pod installation complete! There are 22 dependencies from the Podfile and 31 total pods installed.

[!] Automatically assigning platform ios with version 10.2 on target zone because no platform was specified. Please specify a platform for this target in your Podfile. See https://guides.cocoapods.org/syntax/podfile.html#platform.

  • I cant able to understand its really its pods problem or mac os problem.

  • Even I tried creating the dummy project and installing the Moya-ObjectMapper pod but no luck

Any help is Appreciated.


Solution

  • Looks like the version in your pod file is different from that of in the podfile.lock .

    Observable+ObjectMapper.swift was replaced with Single+ObjectMapper in release 2.4.

    Instead use the following dependency

    pod 'Moya-ObjectMapper/RxSwift', '~> 2.3.2’ or use the latest pod 'Moya-ObjectMapper/RxSwift', '~> 2.4.2’