Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value of type 'PrimitiveSequence<SingleTrait, Response>' has no member 'mapObject' #93

Open
dfabreguette opened this issue Oct 18, 2018 · 4 comments

Comments

@dfabreguette
Copy link

dfabreguette commented Oct 18, 2018

Hi,
I upgraded to latest Moya / RxSwift :

- Moya (11.0.2):
    - Moya/Core (= 11.0.2)
  - Moya-ObjectMapper/Core (2.7):
    - Moya (~> 11)
    - ObjectMapper (~> 3.3)
  - Moya-ObjectMapper/RxSwift (2.7):
    - Moya-ObjectMapper/Core
    - RxSwift (~> 4.1)
  - Moya/Core (11.0.2):
    - Alamofire (~> 4.1)
    - Result (~> 3.0)
  - Moya/RxSwift (11.0.2):
    - Moya/Core
    - RxSwift (~> 4.0)

And I got this error using new rx syntax :

"Value of type 'PrimitiveSequence<SingleTrait, Response>' has no member 'mapObject'"

Here's my request code :

_ = self.api_manager
                    .rx.request(
                        .auth(accessToken: token)
                    )
                    .mapObject(User.self)
                    .subscribe({ event in
                        ...
                    })
@bmoliveira
Copy link
Owner

Hi, sorry for taking so long to respond. Did you find out a solution/the problem for this?

@fernandomatal
Copy link

Hey @dfabreguette-ap, did you find any solution for this? I'm currently having the same problem and I can't find anything online.

Thanks!

@dfabreguette
Copy link
Author

hey @fernandomatal, I think I just upgraded to Moya-ObjectMapper (2.7) and made sure it is compiled with Swift 4.2.

Here's my podfile script :

# store all pods that need to be compiled with specific Swift version
swift_42_pods = %w(Moya-ObjectMapper)

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        if swift_42_pods.include? target.to_s
            # add the build settings to the target config
            config.build_settings['SWIFT_VERSION'] = '4.2'
        end
      end
    end
  end

Hope it will help !

@fernandomatal
Copy link

Thanks @dfabreguette-ap,

I will try this and see if it helps to fix the issue.

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants