tristanhimmelman / AlamofireObjectMapper

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

dyld: Symbol not found: _$s10Foundation11JSONDecoderC9Alamofire11DataDecoderADWP #269

Open informatimago opened 5 years ago

informatimago commented 5 years ago

Trying to compile the project http://github.com/aleene/openfoodfacts-ios with Xcode.app 10.2.1 (10E1001), swift 5.0.1; using the Cartfile:

github "Alamofire/Alamofire" >= 4.6
github "tristanhimmelman/AlamofireObjectMapper" >= 4.1.0
github "onevcat/Kingfisher" >= 5.0
github "xmartlabs/XLPagerTabStrip" >= 7.0
github "Tovkal/ImageViewer" >= 0.1.4
github "DaveWoodCom/XCGLogger"
github "Daltron/NotificationBanner"
github "httpswift/swifter" "stable"
github "SVProgressHUD/SVProgressHUD" >= 2.2.1
github "hackiftekhar/IQKeyboardManager" >= 5.0.6
github "kishikawakatsumi/KeychainAccess"
github "PiXeL16/IBLocalizable" "Swift4"
github "realm/realm-cocoa"
github "SnapKit/SnapKit"
github "scenee/FloatingPanel" >= 1.3.5
github "TimOliver/TOCropViewController"
github "AliSoftware/OHHTTPStubs" >= 7.0.0

and after a successful compilation of all those dependencies with:

carthage outdated
carthage update

and a successful compilation of the app in Xcode, cf https://github.com/informatimago/openfoodfacts-ios/tree/upgrades--xcode-10.2.1--swift-5.0.1 I get at run-time:

dyld: Symbol not found: _$s10Foundation11JSONDecoderC9Alamofire11DataDecoderADWP
  Referenced from: /private/var/containers/Bundle/Application/03307A99-2C6E-4C31-BAF9-E99081087CB5/OpenFoodFacts.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
  Expected in: /private/var/containers/Bundle/Application/03307A99-2C6E-4C31-BAF9-E99081087CB5/OpenFoodFacts.app/Frameworks/Alamofire.framework/Alamofire
 in /private/var/containers/Bundle/Application/03307A99-2C6E-4C31-BAF9-E99081087CB5/OpenFoodFacts.app/Frameworks/AlamofireObjectMapper.framework/AlamofireObjectMapper
(lldb) 

The occurrences of JSONDecoder are found there:

find /Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios -type f -exec grep -nH JSONDecoder {} +
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/AlamofireObjectMapper/AlamofireObjectMapper.swift:208:    /// The `JSONDecoder` instance used to decode responses.
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/AlamofireObjectMapper/AlamofireObjectMapper.swift:209:    public let decoder: DataDecoder = JSONDecoder()
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/AlamofireObjectMapper/AlamofireObjectMapper.swift:263:    /// The `JSONDecoder` instance used to decode responses.
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/AlamofireObjectMapper/AlamofireObjectMapper.swift:264:    public let decoder: DataDecoder = JSONDecoder()
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:538:/// `JSONDecoder` automatically conforms to `DataDecoder`.
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:539:extension JSONDecoder: DataDecoder { }
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:544:/// `DataDecoder`. By default, this is an instance of `JSONDecoder`. Additionally, a request returning `nil` or no data
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:548:    /// The `JSONDecoder` instance used to decode responses.
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:558:    ///   - decoder:           The `JSONDecoder`. Defaults to a `JSONDecoder()`.
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:562:    public init(decoder: DataDecoder = JSONDecoder(),
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:599:    ///   - decoder:           The `DataDecoder` to use to decode the response. Defaults to a `JSONDecoder` with default
/Users/pjb/works/sbde/dependencies/informatimago/openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/Source/ResponseSerialization.swift:605:                                                decoder: DataDecoder = JSONDecoder(),

The strange thing is that there seem to be a recursive carthage checkout: openfoodfacts-ios/Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire

aletz commented 5 years ago

I have a similar issue:

dyld: Symbol not found: _$s9Alamofire22DataResponseSerializerVyxGAA0bcD8ProtocolAAMc

lingfengmarskey commented 5 years ago

me too

clowestab commented 5 years ago

I am having this exact issue too. Did you find a resolution?

SeungIlWoo commented 5 years ago

i am having same issue too.

andrebng commented 5 years ago

Same here

andrebng commented 5 years ago

Directly referencing to github "tristanhimmelman/AlamofireObjectMapper" ~> 5.2

fixed my issue...

RomanPodymov commented 5 years ago

Hello @informatimago Are you still able to reproduce the issue with AlamofireObjectMapper 6.1.0? If not, please close the issue.

steelzeh commented 4 years ago

This is still happening with AlamofireObjectMapper 6.1.0

NjeriNjoroge commented 4 years ago

Changing the target devices to iOS 13.0 fixed my issue in Xcode