简体   繁体   中英

AFNetworking 2.0 “_NSURLSessionTransferSizeUnknown” linking error on Mac OS X 10.8

I'm using

  • AFNetworking 2.0
  • Mac OS X 10.8.0
  • Xcode 5

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...

Try adding the following frameworks:

SystemConfiguration
Security
CFNetwork

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM