tristanhimmelman / AlamofireObjectMapper

An Alamofire extension which converts JSON response data into swift objects using ObjectMapper
MIT License
2.66k stars 474 forks source link

Error when building AlamofireObjectMapper (6.0.0) with Xcode 10.2 & Swift 5 #270

Closed YMonnier closed 5 years ago

YMonnier commented 5 years ago

Pods

Analyzing dependencies
Downloading dependencies
Using Alamofire (5.0.0-beta.6)
Using AlamofireObjectMapper (6.0.0)
Using ObjectMapper (3.4.2)
Screenshot 2019-04-27 at 7 12 31 PM
ghost commented 5 years ago

Has anyone found a solution to this problem?

nlhdung commented 5 years ago

I have the same issue :(

kateusz commented 5 years ago

Pods

Analyzing dependencies
Downloading dependencies
Using Alamofire (5.0.0-beta.6)
Using AlamofireObjectMapper (6.0.0)
Using ObjectMapper (3.4.2)
Screenshot 2019-04-27 at 7 12 31 PM

The quickest solution is to provide default value, in this case just pass .main DispatchQueue, like below:

return response(queue: queue ?? .main, responseSerializer: DataRequest.ObjectMapperSerializer(keyPath, mapToObject: object, context: context), completionHandler: completionHandler)

tiwari1amrit commented 5 years ago

Have same issue did anyone solved it?

Screen Shot 2019-05-05 at 1 22 27 PM
YMonnier commented 5 years ago

Nop! I changed the library of my project... Now I am using Moya + ObjectMapper

RomanPodymov commented 5 years ago

Fixed in this pull request. As a temporal solution you can add the following line to your Podfile: pod 'Alamofire', '5.0.0-beta.3'

KieranLafferty commented 5 years ago

Still stuck on this

Screen Shot 2019-05-21 at 2 39 31 PM

Was able to resolve other issues locally but it appears it can't differentiate between the method signatures in ImmutableMappable and Mappable's implementation of .mapArray(JSONObject:)

Currently blocked on moving to swift 5 on this 😭Lmk if anyone has a workaround!

RomanPodymov commented 5 years ago

Hello @KieranLafferty I cannot reproduce the issue you reported. Do you use CocoaPods to install AlamofireObjectMapper? If so, do you have the following line pod 'AlamofireObjectMapper', :git => 'https://github.com/RomanPodymov/AlamofireObjectMapper.git', :branch => 'master' in your Podfile?

davisford commented 5 years ago

Is there a solution for Carthage users?

RomanPodymov commented 5 years ago

Hello @davisford Replace github "tristanhimmelman/AlamofireObjectMapper" ~> 5.2 with github "RomanPodymov/AlamofireObjectMapper" "master" in your Cartfile.

RomanPodymov commented 5 years ago

Hello @YMonnier

271 was merged to master. Are you still able to reproduce the issue?

YMonnier commented 5 years ago

Seems good with AlamofireObjectMapper 6.1.0 via Cocoapods ;)

RomanPodymov commented 5 years ago

Seems good with AlamofireObjectMapper 6.1.0 via Cocoapods ;)

In such case close the issue.