user3172069
user3172069

Reputation: 3

AFNetworking 2.0 "_NSURLSessionTransferSizeUnknown" linking error on Mac OS X 10.8

I'm using

But I'm receiving the following error:

Undefined symbols for architecture x86_64:
  "_NSURLSessionTransferSizeUnknown", referenced from:
      -[AFURLSessionManagerTaskDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:] in AFURLSessionManager-C493EEE75215474B.o
      -[AFURLSessionManager uploadTaskWithTask:progress:completionHandler:] in AFURLSessionManager-C493EEE75215474B.o

ld: symbol(s) not found for architecture x86_64
clang: error: `linker command failed with exit code 1 (use -v to see invocation)`

I'm using AFNetworking 2.0 in an Mac OS X project...

Upvotes: 0

Views: 1780

Answers (3)

PedroAGSantos
PedroAGSantos

Reputation: 2346

For those of you who crashes on ios 6 sdk and using cocoapods check on your pod file. platform :ios, '6.0' needs to be 6 not 7

Solved the problem for me.

Upvotes: 1

Rob
Rob

Reputation: 437792

If you are using Mac OS 10.8, the error seems plausible, because NSURLSessionTransferSizeUnknown (and NSURLSession and AFURLSessionManager) requires Mac OS 10.9 or iOS 7.0 and later.

There was a rendition of AFNetworking 2.0 that was not correctly checking the OS version and trying to include AFURLSessionManager even when using targets prior to 10.9 and iOS 7.0. This has since been remedied, and this particular problem should go away if you update your AFNetworking 2.0 code to the latest version.

Upvotes: 0

Dinesh
Dinesh

Reputation: 2204

Try adding the following frameworks:

SystemConfiguration
Security
CFNetwork

Upvotes: 1

Related Questions