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

I use

  • AFNetworking 2.0
  • Mac OS X 10.8.0
  • Xcode 5

But I get 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 am using AFNetworking 2.0 in a Mac OS X project ...

0
source share
3 answers

If you use Mac OS 10.8, the error seems plausible because NSURLSessionTransferSizeUnknown( NSURLSessionand AFURLSessionManager) Mac OS 10.9 or iOS 7.0 and later are required.

AFNetworking 2.0 appeared, which incorrectly checked the OS version and tried to enable it AFURLSessionManagereven when using targets up to 10.9 and iOS 7.0. This has been fixed since then, and this particular problem should disappear if you upgrade your AFNetworking 2.0 code to the latest version.

0
source

Try adding the following frameworks:

SystemConfiguration
Security
CFNetwork
+1
source

For those of you who fall on ios 6 sdk and using cocoapods , check out your swap file. platform: ios, '6.0' should be 6 not 7

Solved the problem for me.

+1
source

Source: https://habr.com/ru/post/1524036/


All Articles