AlamofireObjectMapper icon indicating copy to clipboard operation
AlamofireObjectMapper copied to clipboard

dyld: Symbol not found: _$s10Foundation11JSONDecoderC9Alamofire11DataDecoderADWP

Open informatimago opened this issue 5 years ago • 9 comments

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

informatimago avatar Apr 23 '19 03:04 informatimago

I have a similar issue:

dyld: Symbol not found: _$s9Alamofire22DataResponseSerializerVyxGAA0bcD8ProtocolAAMc

aletz avatar Apr 24 '19 21:04 aletz

me too

lingfengmarskey avatar May 07 '19 12:05 lingfengmarskey

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

clowestab avatar May 31 '19 17:05 clowestab

i am having same issue too.

SeungIlWoo avatar Jun 17 '19 07:06 SeungIlWoo

Same here

andrebng avatar Jul 09 '19 12:07 andrebng

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

fixed my issue...

andrebng avatar Jul 09 '19 12:07 andrebng

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

RomanPodymov avatar Sep 11 '19 13:09 RomanPodymov

This is still happening with AlamofireObjectMapper 6.1.0

steelzeh avatar Sep 20 '19 11:09 steelzeh

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

NjeriNjoroge avatar Dec 09 '19 11:12 NjeriNjoroge