JetBrains / kotlin-native

Kotlin/Native infrastructure
Apache License 2.0
7.02k stars 566 forks source link

Using Carthage/Cocoapods dependencies. #1822

Closed michalchudziak closed 4 years ago

michalchudziak commented 6 years ago

Hey!

Great job with the compiler so far!! I wanted to integrate an external library to the project (ie. Alamofire). I've used Carthage to build the framework and add the following lines to my build.gradle file

konanArtifacts {
    def productsDir = new File("Carthage/Build/iOS").absolutePath

    interop('Alamofire') {
        defFile 'Alamofire.def'

        compilerOpts "-F${productsDir}"
        linkerOpts "-F${productsDir}"

        includeDirs "${productsDir}/Alamofire.framework/Headers"
    }
    program('Scaffolding') {
        libraries {
          artifact 'Alamofire'
        }

        linkerOpts '-rpath', '@executable_path/Frameworks'
        linkerOpts "-F${productsDir}"
    }
}

The .def file looks like this:

depends = Foundation UIKit darwin posix
language = Objective-C
package = framework.alamofire
headers = Alamofire.h Alamofire-Swift.h

headerFilter = **

compilerOpts = -framework Alamofire
linkerOpts = -framework Alamofire

While building kotlin I'm experiencing following error:

Error:Exception in thread "main" java.lang.Error: /blablabla/Carthage/Build/iOS/Alamofire.framework/Headers/Alamofire.h:25:1: error: use of '@import' when modules are disabled

These are my xCode settings for Obj-C modules: image

Is this a problem of the library's compatibbility with K/N? Am I doing something wrong?

Also second question comes to my mind: https://github.com/JetBrains/kotlin-native/issues/1559 Here you claim that we can use CocoaPods (no dedicated gradle plugin yet) - do you have any guide on how to use this kind of libraries? What are the limitations?

ildarsharafutdinov commented 6 years ago

1785

Try adding -fmodules to compilerOpts to turn on @import support.

michalchudziak commented 6 years ago

@ildarsharafutdinov I've seen your issue. I've tried adding it like:

    interop('Alamofire') {
        defFile 'Alamofire.def'

        compilerOpts "-F${productsDir}", '-fmodules'
        linkerOpts "-F${productsDir}"

        includeDirs "${productsDir}/Alamofire.framework/Headers"
    }

or:

depends = Foundation UIKit darwin posix
language = Objective-C
package = framework.alamofire
headers = Alamofire.h Alamofire-Swift.h

headerFilter = **

compilerOpts = -fmodules -framework Alamofire
linkerOpts = -framework Alamofire

The import issue seems to be gone, but kotlin is throwing Error:(17, 5) expecting member declaration at me when I'm trying to use Alamofire (import framework.alamofire.*) Import doesn't seem to work :(

ildarsharafutdinov commented 6 years ago

@mike866,

I seem to have managed to build & link Alamofire as follows(although I didn't run it). I'm not sure how it differs from your setup.

def:

language = Objective-C
package = framework.alamofire
headers = Alamofire.h Alamofire-Swift.h
headerFilter = **

compilerOpts = -framework Alamofire -fmodules
linkerOpts = -framework Alamofire

build.gradle:

apply plugin: 'konan'

konan.targets = [
  'iphone',
  'iphone_sim'
]

konanArtifacts {

  def productsDir = new File("Carthage/Build/iOS").absolutePath

  interop('Alamofire') {
    defFile 'Alamofire.def'

    compilerOpts "-F${productsDir}" 
    linkerOpts "-F${productsDir}"

    includeDirs "${productsDir}/Alamofire.framework/Headers"
  }

  program('app') {
    libraries {
      artifact 'Alamofire'
    }

    linkerOpts '-rpath', '@executable_path/Frameworks'
    linkerOpts "-F${productsDir}"
  }
}

main.kt:

import kotlinx.cinterop.*
import platform.Foundation.*
import platform.UIKit.*
import framework.alamofire.*
...
../gradlew compileKonanappIos_x64

BUILD SUCCESSFUL in 0s
3 actionable tasks: 1 executed, 2 up-to-date

My working dir is kotlin-native/samples/uikit.

ildarsharafutdinov commented 6 years ago
../../dist/bin/klib contents ./build/konan/libs/ios_x64/Alamofire.klib
warning: IMPORTANT: the library format is unstable now. It can change with any new git commit without warning!

package framework.alamofire {
    var AlamofireVersionNumber: Double
    val AlamofireVersionString: CArrayPointer<ByteVar /* = ByteVarOf<Byte> */> /* = CPointer<ByteVarOf<Byte>> */
    val SWIFT_TYPEDEFS: Int
}

hmm... It looks like something went wrong. Here is what I got for AFNetworking:

../../dist/bin/klib contents ./build/konan/libs/ios_x64/AFNetworking.klib
warning: IMPORTANT: the library format is unstable now. It can change with any new git commit without warning!

package framework.afnetworking {
    val AFHTTPRequestQueryStringDefaultStyle: AFHTTPRequestQueryStringSerializationStyle /* = Long */ = 0.toLong()
    val AFNetworkReachabilityStatusNotReachable: AFNetworkReachabilityStatus /* = Long */ = 0.toLong()
    val AFNetworkReachabilityStatusReachableViaWWAN: AFNetworkReachabilityStatus /* = Long */ = 1.toLong()
    val AFNetworkReachabilityStatusReachableViaWiFi: AFNetworkReachabilityStatus /* = Long */ = 2.toLong()
    val AFNetworkReachabilityStatusUnknown: AFNetworkReachabilityStatus /* = Long */ = -1.toLong()
    val AFNetworkingOperationFailingURLRequestErrorKey: String
    val AFNetworkingOperationFailingURLResponseDataErrorKey: String
    val AFNetworkingOperationFailingURLResponseErrorKey: String
    val AFNetworkingReachabilityDidChangeNotification: String
    val AFNetworkingReachabilityNotificationStatusItem: String
    val AFNetworkingTaskDidCompleteAssetPathKey: String
    val AFNetworkingTaskDidCompleteErrorKey: String
    val AFNetworkingTaskDidCompleteNotification: String
    val AFNetworkingTaskDidCompleteResponseDataKey: String
    val AFNetworkingTaskDidCompleteResponseSerializerKey: String
    val AFNetworkingTaskDidCompleteSerializedResponseKey: String
    val AFNetworkingTaskDidResumeNotification: String
    val AFNetworkingTaskDidSuspendNotification: String
    val AFURLRequestSerializationErrorDomain: String
    val AFURLResponseSerializationErrorDomain: String
    val AFURLSessionDidInvalidateNotification: String
    val AFURLSessionDownloadTaskDidFailToMoveFileNotification: String
    val AF_CAN_USE_AT_AVAILABLE: Int
    val kAFUploadStream3GSuggestedDelay: NSTimeInterval /* = Double */
    val kAFUploadStream3GSuggestedPacketSize: NSUInteger /* = Long */
    fun AFPercentEscapedStringFromString(string: String): String
    fun AFQueryStringFromParameters(parameters: Map<Any?, *>): String
    fun AFStringFromNetworkReachabilityStatus(status: AFNetworkReachabilityStatus /* = Long */): String

    @ExternalObjCClass open class AFCompoundResponseSerializer : AFHTTPResponseSerializer {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        val responseSerializers: List<*>
        @ObjCMethod(bridge = "objcKniBridge176", selector = "init") external override fun init(): AFCompoundResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge178", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFCompoundResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge174", selector = "responseSerializers") open external fun responseSerializers(): List<*>
        companion object : AFCompoundResponseSerializerMeta, ObjCClassOf<AFCompoundResponseSerializer>
    }

    @ExternalObjCClass open class AFCompoundResponseSerializerMeta : AFHTTPResponseSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge172", selector = "alloc") external override fun alloc(): AFCompoundResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge170", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFCompoundResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge164", selector = "compoundSerializerWithResponseSerializers:") open external fun compoundSerializerWithResponseSerializers(responseSerializers: List<*>): AFCompoundResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge168", selector = "new") external override fun new(): AFCompoundResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge166", selector = "serializer") external override fun serializer(): AFCompoundResponseSerializer
    }

    @ExternalObjCClass open class AFHTTPRequestSerializer : NSObject, AFURLRequestSerializationProtocol {
        @ObjCConstructor(designated = true, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var HTTPMethodsEncodingParametersInURI: Set<*>
        val HTTPRequestHeaders: Map<Any?, *>
        var HTTPShouldHandleCookies: Boolean
        var HTTPShouldUsePipelining: Boolean
        var allowsCellularAccess: Boolean
        var cachePolicy: NSURLRequestCachePolicy /* = Long */
        var networkServiceType: NSURLRequestNetworkServiceType /* = Long */
        var stringEncoding: NSStringEncoding /* = Long */
        var timeoutInterval: NSTimeInterval /* = Double */
        @ObjCMethod(bridge = "objcKniBridge238", selector = "HTTPMethodsEncodingParametersInURI") open external fun HTTPMethodsEncodingParametersInURI(): Set<*>
        @ObjCMethod(bridge = "objcKniBridge236", selector = "HTTPRequestHeaders") open external fun HTTPRequestHeaders(): Map<Any?, *>
        @ObjCMethod(bridge = "objcKniBridge220", selector = "HTTPShouldHandleCookies") open external fun HTTPShouldHandleCookies(): Boolean
        @ObjCMethod(bridge = "objcKniBridge224", selector = "HTTPShouldUsePipelining") open external fun HTTPShouldUsePipelining(): Boolean
        @ObjCMethod(bridge = "objcKniBridge212", selector = "allowsCellularAccess") open external fun allowsCellularAccess(): Boolean
        @ObjCMethod(bridge = "objcKniBridge216", selector = "cachePolicy") open external fun cachePolicy(): NSURLRequestCachePolicy /* = Long */
        @ObjCMethod(bridge = "objcKniBridge250", selector = "class") open external fun `class`(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge196", selector = "clearAuthorizationHeader") open external fun clearAuthorizationHeader()
        @ObjCMethod(bridge = "objcKniBridge264", selector = "conformsToProtocol:") open external fun conformsToProtocol(aProtocol: Protocol?): Boolean
        @ObjCMethod(bridge = "objcKniBridge276", selector = "copyWithZone:") open external fun copyWithZone(zone: CPointer<NSZone /* = _NSZone */>?): Any
        @ObjCMethod(bridge = "objcKniBridge278", selector = "debugDescription") open external fun debugDescription(): String?
        @ObjCMethod(bridge = "objcKniBridge272", selector = "description") open external fun description(): String?
        @ObjCMethod(bridge = "objcKniBridge274", selector = "encodeWithCoder:") open external fun encodeWithCoder(aCoder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge268", selector = "hash") open external fun hash(): NSUInteger /* = Long */
        @ObjCMethod(bridge = "objcKniBridge242", selector = "init") open external fun init(): AFHTTPRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge244", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFHTTPRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge248", selector = "isEqual:") open external fun isEqual(`object`: Any?): Boolean
        @ObjCMethod(bridge = "objcKniBridge260", selector = "isKindOfClass:") open external fun isKindOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge262", selector = "isMemberOfClass:") open external fun isMemberOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge258", selector = "isProxy") open external fun isProxy(): Boolean
        @ObjCMethod(bridge = "objcKniBridge204", selector = "multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:") open external fun multipartFormRequestWithMethod(method: String, URLString: String, parameters: Map<Any?, *>?, constructingBodyWithBlock: ((AFMultipartFormDataProtocol?) -> Unit)?, error: CPointer<ObjCObjectVar<NSError?>>?): NSMutableURLRequest
        @ObjCMethod(bridge = "objcKniBridge228", selector = "networkServiceType") open external fun networkServiceType(): NSURLRequestNetworkServiceType /* = Long */
        @ObjCMethod(bridge = "objcKniBridge252", selector = "performSelector:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Any?
        @ObjCMethod(bridge = "objcKniBridge254", selector = "performSelector:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge256", selector = "performSelector:withObject:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?, _withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge246", selector = "requestBySerializingRequest:withParameters:error:") external override fun requestBySerializingRequest(request: NSURLRequest, withParameters: Any?, error: CPointer<ObjCObjectVar<NSError?>>?): NSURLRequest?
        @ObjCMethod(bridge = "objcKniBridge202", selector = "requestWithMethod:URLString:parameters:error:") open external fun requestWithMethod(method: String, URLString: String, parameters: Any?, error: CPointer<ObjCObjectVar<NSError?>>?): NSMutableURLRequest
        @ObjCMethod(bridge = "objcKniBridge206", selector = "requestWithMultipartFormRequest:writingStreamContentsToFile:completionHandler:") open external fun requestWithMultipartFormRequest(request: NSURLRequest, writingStreamContentsToFile: NSURL, completionHandler: ((NSError?) -> Unit)?): NSMutableURLRequest
        @ObjCMethod(bridge = "objcKniBridge266", selector = "respondsToSelector:") open external fun respondsToSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Boolean
        @ObjCMethod(bridge = "objcKniBridge214", selector = "setAllowsCellularAccess:") open external fun setAllowsCellularAccess(allowsCellularAccess: Boolean)
        @ObjCMethod(bridge = "objcKniBridge194", selector = "setAuthorizationHeaderFieldWithUsername:password:") open external fun setAuthorizationHeaderFieldWithUsername(username: String, password: String)
        @ObjCMethod(bridge = "objcKniBridge218", selector = "setCachePolicy:") open external fun setCachePolicy(cachePolicy: NSURLRequestCachePolicy /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge240", selector = "setHTTPMethodsEncodingParametersInURI:") open external fun setHTTPMethodsEncodingParametersInURI(HTTPMethodsEncodingParametersInURI: Set<*>)
        @ObjCMethod(bridge = "objcKniBridge222", selector = "setHTTPShouldHandleCookies:") open external fun setHTTPShouldHandleCookies(HTTPShouldHandleCookies: Boolean)
        @ObjCMethod(bridge = "objcKniBridge226", selector = "setHTTPShouldUsePipelining:") open external fun setHTTPShouldUsePipelining(HTTPShouldUsePipelining: Boolean)
        @ObjCMethod(bridge = "objcKniBridge230", selector = "setNetworkServiceType:") open external fun setNetworkServiceType(networkServiceType: NSURLRequestNetworkServiceType /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge200", selector = "setQueryStringSerializationWithBlock:") open external fun setQueryStringSerializationWithBlock(block: ((NSURLRequest?, Any?, CPointer<ObjCObjectVar<NSError?>>?) -> String?)?)
        @ObjCMethod(bridge = "objcKniBridge198", selector = "setQueryStringSerializationWithStyle:") open external fun setQueryStringSerializationWithStyle(style: AFHTTPRequestQueryStringSerializationStyle /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge210", selector = "setStringEncoding:") open external fun setStringEncoding(stringEncoding: NSStringEncoding /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge234", selector = "setTimeoutInterval:") open external fun setTimeoutInterval(timeoutInterval: NSTimeInterval /* = Double */)
        @ObjCMethod(bridge = "objcKniBridge190", selector = "setValue:forHTTPHeaderField:") open external fun setValue(value: String?, forHTTPHeaderField: String)
        @ObjCMethod(bridge = "objcKniBridge208", selector = "stringEncoding") open external fun stringEncoding(): NSStringEncoding /* = Long */
        @ObjCMethod(bridge = "objcKniBridge270", selector = "superclass") open external fun superclass(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge232", selector = "timeoutInterval") open external fun timeoutInterval(): NSTimeInterval /* = Double */
        @ObjCMethod(bridge = "objcKniBridge192", selector = "valueForHTTPHeaderField:") open external fun valueForHTTPHeaderField(field: String): String?
        companion object : AFHTTPRequestSerializerMeta, ObjCClassOf<AFHTTPRequestSerializer>
    }

    @ExternalObjCClass open class AFHTTPRequestSerializerMeta : NSObjectMeta, AFURLRequestSerializationProtocolMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge186", selector = "alloc") open external fun alloc(): AFHTTPRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge184", selector = "allocWithZone:") open external fun allocWithZone(zone: CPointer<_NSZone>?): AFHTTPRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge182", selector = "new") open external fun new(): AFHTTPRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge180", selector = "serializer") open external fun serializer(): AFHTTPRequestSerializer
        @ObjCMethod(bridge = "objcKniBridge188", selector = "supportsSecureCoding") open external fun supportsSecureCoding(): Boolean
    }

    @ExternalObjCClass open class AFHTTPResponseSerializer : NSObject, AFURLResponseSerializationProtocol {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var acceptableContentTypes: Set<*>?
        var acceptableStatusCodes: NSIndexSet?
        var stringEncoding: NSStringEncoding /* = Long */
        @ObjCMethod(bridge = "objcKniBridge48", selector = "acceptableContentTypes") open external fun acceptableContentTypes(): Set<*>?
        @ObjCMethod(bridge = "objcKniBridge44", selector = "acceptableStatusCodes") open external fun acceptableStatusCodes(): NSIndexSet?
        @ObjCMethod(bridge = "objcKniBridge58", selector = "class") open external fun `class`(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge72", selector = "conformsToProtocol:") open external fun conformsToProtocol(aProtocol: Protocol?): Boolean
        @ObjCMethod(bridge = "objcKniBridge84", selector = "copyWithZone:") open external fun copyWithZone(zone: CPointer<NSZone /* = _NSZone */>?): Any
        @ObjCMethod(bridge = "objcKniBridge86", selector = "debugDescription") open external fun debugDescription(): String?
        @ObjCMethod(bridge = "objcKniBridge80", selector = "description") open external fun description(): String?
        @ObjCMethod(bridge = "objcKniBridge82", selector = "encodeWithCoder:") open external fun encodeWithCoder(aCoder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge76", selector = "hash") open external fun hash(): NSUInteger /* = Long */
        @ObjCMethod(bridge = "objcKniBridge36", selector = "init") open external fun init(): AFHTTPResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge52", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFHTTPResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge56", selector = "isEqual:") open external fun isEqual(`object`: Any?): Boolean
        @ObjCMethod(bridge = "objcKniBridge68", selector = "isKindOfClass:") open external fun isKindOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge70", selector = "isMemberOfClass:") open external fun isMemberOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge66", selector = "isProxy") open external fun isProxy(): Boolean
        @ObjCMethod(bridge = "objcKniBridge60", selector = "performSelector:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Any?
        @ObjCMethod(bridge = "objcKniBridge62", selector = "performSelector:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge64", selector = "performSelector:withObject:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?, _withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge74", selector = "respondsToSelector:") open external fun respondsToSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Boolean
        @ObjCMethod(bridge = "objcKniBridge54", selector = "responseObjectForResponse:data:error:") external override fun responseObjectForResponse(response: NSURLResponse?, data: NSData?, error: CPointer<ObjCObjectVar<NSError?>>?): Any?
        @ObjCMethod(bridge = "objcKniBridge50", selector = "setAcceptableContentTypes:") open external fun setAcceptableContentTypes(acceptableContentTypes: Set<*>?)
        @ObjCMethod(bridge = "objcKniBridge46", selector = "setAcceptableStatusCodes:") open external fun setAcceptableStatusCodes(acceptableStatusCodes: NSIndexSet?)
        @ObjCMethod(bridge = "objcKniBridge42", selector = "setStringEncoding:") open external fun setStringEncoding(stringEncoding: NSStringEncoding /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge40", selector = "stringEncoding") open external fun stringEncoding(): NSStringEncoding /* = Long */
        @ObjCMethod(bridge = "objcKniBridge78", selector = "superclass") open external fun superclass(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge38", selector = "validateResponse:data:error:") open external fun validateResponse(response: NSHTTPURLResponse?, data: NSData?, error: CPointer<ObjCObjectVar<NSError?>>?): Boolean
        companion object : AFHTTPResponseSerializerMeta, ObjCClassOf<AFHTTPResponseSerializer>
    }

    @ExternalObjCClass open class AFHTTPResponseSerializerMeta : NSObjectMeta, AFURLResponseSerializationProtocolMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge32", selector = "alloc") open external fun alloc(): AFHTTPResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge30", selector = "allocWithZone:") open external fun allocWithZone(zone: CPointer<_NSZone>?): AFHTTPResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge28", selector = "new") open external fun new(): AFHTTPResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge26", selector = "serializer") open external fun serializer(): AFHTTPResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge34", selector = "supportsSecureCoding") open external fun supportsSecureCoding(): Boolean
    }

    @ExternalObjCClass open class AFHTTPSessionManager : AFURLSessionManager, NSSecureCodingProtocol, NSCopyingProtocol {
        @ObjCConstructor(designated = false, initSelector = "initWithBaseURL:") constructor(baseURL: NSURL?)
        @ObjCConstructor(designated = true, initSelector = "initWithBaseURL:sessionConfiguration:") constructor(baseURL: NSURL?, sessionConfiguration: NSURLSessionConfiguration?)
        @ObjCConstructor(designated = false, initSelector = "initWithSessionConfiguration:") constructor(sessionConfiguration: NSURLSessionConfiguration?)
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        val baseURL: NSURL?
        var requestSerializer: AFHTTPRequestSerializer
        @ObjCMethod(bridge = "objcKniBridge582", selector = "DELETE:parameters:success:failure:") open external fun DELETE(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge566", selector = "GET:parameters:progress:success:failure:") open external fun GET(URLString: String, parameters: Any?, progress: ((NSProgress?) -> Unit)?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge564", selector = "GET:parameters:success:failure:") open external fun GET(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge568", selector = "HEAD:parameters:success:failure:") open external fun HEAD(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge580", selector = "PATCH:parameters:success:failure:") open external fun PATCH(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge576", selector = "POST:parameters:constructingBodyWithBlock:progress:success:failure:") open external fun POST(URLString: String, parameters: Any?, constructingBodyWithBlock: ((AFMultipartFormDataProtocol?) -> Unit)?, progress: ((NSProgress?) -> Unit)?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge574", selector = "POST:parameters:constructingBodyWithBlock:success:failure:") open external fun POST(URLString: String, parameters: Any?, constructingBodyWithBlock: ((AFMultipartFormDataProtocol?) -> Unit)?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge572", selector = "POST:parameters:progress:success:failure:") open external fun POST(URLString: String, parameters: Any?, progress: ((NSProgress?) -> Unit)?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge570", selector = "POST:parameters:success:failure:") open external fun POST(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge578", selector = "PUT:parameters:success:failure:") open external fun PUT(URLString: String, parameters: Any?, success: ((NSURLSessionDataTask?, Any?) -> Unit)?, failure: ((NSURLSessionDataTask?, NSError?) -> Unit)?): NSURLSessionDataTask?
        @ObjCMethod(bridge = "objcKniBridge584", selector = "baseURL") open external fun baseURL(): NSURL?
        @ObjCMethod(bridge = "objcKniBridge602", selector = "copyWithZone:") external override fun copyWithZone(zone: CPointer<NSZone /* = _NSZone */>?): Any
        @ObjCMethod(bridge = "objcKniBridge600", selector = "encodeWithCoder:") external override fun encodeWithCoder(aCoder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge596", selector = "init") external override fun init(): AFHTTPSessionManager?
        @ObjCMethod(bridge = "objcKniBridge560", selector = "initWithBaseURL:") open external fun initWithBaseURL(url: NSURL?): AFHTTPSessionManager
        @ObjCMethod(bridge = "objcKniBridge562", selector = "initWithBaseURL:sessionConfiguration:") open external fun initWithBaseURL(url: NSURL?, sessionConfiguration: NSURLSessionConfiguration?): AFHTTPSessionManager
        @ObjCMethod(bridge = "objcKniBridge598", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFHTTPSessionManager?
        @ObjCMethod(bridge = "objcKniBridge594", selector = "initWithSessionConfiguration:") external override fun initWithSessionConfiguration(configuration: NSURLSessionConfiguration?): AFHTTPSessionManager
        @ObjCMethod(bridge = "objcKniBridge586", selector = "requestSerializer") open external fun requestSerializer(): AFHTTPRequestSerializer
        @ObjCMethod(bridge = "objcKniBridge590", selector = "responseSerializer") external override fun responseSerializer(): AFHTTPResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge588", selector = "setRequestSerializer:") open external fun setRequestSerializer(requestSerializer: AFHTTPRequestSerializer)
        @ObjCMethod(bridge = "objcKniBridge592", selector = "setResponseSerializer:") open external fun setResponseSerializer(responseSerializer: AFHTTPResponseSerializer)
        companion object : AFHTTPSessionManagerMeta, ObjCClassOf<AFHTTPSessionManager>
    }

    @ExternalObjCClass open class AFHTTPSessionManagerMeta : AFURLSessionManagerMeta, NSSecureCodingProtocolMeta, NSCopyingProtocolMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge556", selector = "alloc") external override fun alloc(): AFHTTPSessionManager?
        @ObjCMethod(bridge = "objcKniBridge554", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFHTTPSessionManager?
        @ObjCMethod(bridge = "objcKniBridge550", selector = "manager") open external fun manager(): AFHTTPSessionManager
        @ObjCMethod(bridge = "objcKniBridge552", selector = "new") external override fun new(): AFHTTPSessionManager?
        @ObjCMethod(bridge = "objcKniBridge558", selector = "supportsSecureCoding") external override fun supportsSecureCoding(): Boolean
    }

    @ExternalObjCClass open class AFImageResponseSerializer : AFHTTPResponseSerializer {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var automaticallyInflatesResponseImage: Boolean
        var imageScale: CGFloat /* = Double */
        @ObjCMethod(bridge = "objcKniBridge156", selector = "automaticallyInflatesResponseImage") open external fun automaticallyInflatesResponseImage(): Boolean
        @ObjCMethod(bridge = "objcKniBridge152", selector = "imageScale") open external fun imageScale(): CGFloat /* = Double */
        @ObjCMethod(bridge = "objcKniBridge160", selector = "init") external override fun init(): AFImageResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge162", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFImageResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge158", selector = "setAutomaticallyInflatesResponseImage:") open external fun setAutomaticallyInflatesResponseImage(automaticallyInflatesResponseImage: Boolean)
        @ObjCMethod(bridge = "objcKniBridge154", selector = "setImageScale:") open external fun setImageScale(imageScale: CGFloat /* = Double */)
        companion object : AFImageResponseSerializerMeta, ObjCClassOf<AFImageResponseSerializer>
    }

    @ExternalObjCClass open class AFImageResponseSerializerMeta : AFHTTPResponseSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge150", selector = "alloc") external override fun alloc(): AFImageResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge148", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFImageResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge146", selector = "new") external override fun new(): AFImageResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge144", selector = "serializer") external override fun serializer(): AFImageResponseSerializer
    }

    @ExternalObjCClass open class AFJSONRequestSerializer : AFHTTPRequestSerializer {
        @ObjCConstructor(designated = true, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var writingOptions: NSJSONWritingOptions /* = Long */
        @ObjCMethod(bridge = "objcKniBridge294", selector = "init") external override fun init(): AFJSONRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge296", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFJSONRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge292", selector = "setWritingOptions:") open external fun setWritingOptions(writingOptions: NSJSONWritingOptions /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge290", selector = "writingOptions") open external fun writingOptions(): NSJSONWritingOptions /* = Long */
        companion object : AFJSONRequestSerializerMeta, ObjCClassOf<AFJSONRequestSerializer>
    }

    @ExternalObjCClass open class AFJSONRequestSerializerMeta : AFHTTPRequestSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge288", selector = "alloc") external override fun alloc(): AFJSONRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge286", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFJSONRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge284", selector = "new") external override fun new(): AFJSONRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge282", selector = "serializer") external override fun serializer(): AFJSONRequestSerializer
        @ObjCMethod(bridge = "objcKniBridge280", selector = "serializerWithWritingOptions:") open external fun serializerWithWritingOptions(writingOptions: NSJSONWritingOptions /* = Long */): AFJSONRequestSerializer
    }

    @ExternalObjCClass open class AFJSONResponseSerializer : AFHTTPResponseSerializer {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var readingOptions: NSJSONReadingOptions /* = Long */
        var removesKeysWithNullValues: Boolean
        @ObjCMethod(bridge = "objcKniBridge106", selector = "init") external override fun init(): AFJSONResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge108", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFJSONResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge98", selector = "readingOptions") open external fun readingOptions(): NSJSONReadingOptions /* = Long */
        @ObjCMethod(bridge = "objcKniBridge102", selector = "removesKeysWithNullValues") open external fun removesKeysWithNullValues(): Boolean
        @ObjCMethod(bridge = "objcKniBridge100", selector = "setReadingOptions:") open external fun setReadingOptions(readingOptions: NSJSONReadingOptions /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge104", selector = "setRemovesKeysWithNullValues:") open external fun setRemovesKeysWithNullValues(removesKeysWithNullValues: Boolean)
        companion object : AFJSONResponseSerializerMeta, ObjCClassOf<AFJSONResponseSerializer>
    }

    @ExternalObjCClass open class AFJSONResponseSerializerMeta : AFHTTPResponseSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge96", selector = "alloc") external override fun alloc(): AFJSONResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge94", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFJSONResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge92", selector = "new") external override fun new(): AFJSONResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge90", selector = "serializer") external override fun serializer(): AFJSONResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge88", selector = "serializerWithReadingOptions:") open external fun serializerWithReadingOptions(readingOptions: NSJSONReadingOptions /* = Long */): AFJSONResponseSerializer
    }

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking10") interface AFMultipartFormDataProtocol : ObjCObject {
        @ObjCMethod(bridge = "objcKniBridge18", selector = "appendPartWithFileData:name:fileName:mimeType:") fun appendPartWithFileData(data: NSData, name: String, fileName: String, mimeType: String)
        @ObjCMethod(bridge = "objcKniBridge14", selector = "appendPartWithFileURL:name:fileName:mimeType:error:") fun appendPartWithFileURL(fileURL: NSURL, name: String, fileName: String, mimeType: String, error: CPointer<ObjCObjectVar<NSError?>>?): Boolean
        @ObjCMethod(bridge = "objcKniBridge12", selector = "appendPartWithFileURL:name:error:") fun appendPartWithFileURL(fileURL: NSURL, name: String, error: CPointer<ObjCObjectVar<NSError?>>?): Boolean
        @ObjCMethod(bridge = "objcKniBridge20", selector = "appendPartWithFormData:name:") fun appendPartWithFormData(data: NSData, name: String)
        @ObjCMethod(bridge = "objcKniBridge22", selector = "appendPartWithHeaders:body:") fun appendPartWithHeaders(headers: Map<Any?, *>?, body: NSData)
        @ObjCMethod(bridge = "objcKniBridge16", selector = "appendPartWithInputStream:name:fileName:length:mimeType:") fun appendPartWithInputStream(inputStream: NSInputStream?, name: String, fileName: String, length: int64_t /* = Long */, mimeType: String)
        @ObjCMethod(bridge = "objcKniBridge24", selector = "throttleBandwidthWithPacketSize:delay:") fun throttleBandwidthWithPacketSize(numberOfBytes: NSUInteger /* = Long */, delay: NSTimeInterval /* = Double */)
    }

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking10") interface AFMultipartFormDataProtocolMeta : ObjCObjectMeta /* = ObjCClass */

    @ExternalObjCClass open class AFNetworkReachabilityManager : NSObject {
        @ObjCConstructor(designated = true, initSelector = "initWithReachability:") constructor(reachability: SCNetworkReachabilityRef? /* = CPointer<__SCNetworkReachability>? */)
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        val networkReachabilityStatus: AFNetworkReachabilityStatus /* = Long */
        val reachable: Boolean
        val reachableViaWWAN: Boolean
        val reachableViaWiFi: Boolean
        @ObjCMethod(bridge = "objcKniBridge392", selector = "init") open external fun init(): AFNetworkReachabilityManager?
        @ObjCMethod(bridge = "objcKniBridge374", selector = "initWithReachability:") open external fun initWithReachability(reachability: SCNetworkReachabilityRef? /* = CPointer<__SCNetworkReachability>? */): AFNetworkReachabilityManager
        @ObjCMethod(bridge = "objcKniBridge386", selector = "isReachable") open external fun isReachable(): Boolean
        @ObjCMethod(bridge = "objcKniBridge388", selector = "isReachableViaWWAN") open external fun isReachableViaWWAN(): Boolean
        @ObjCMethod(bridge = "objcKniBridge390", selector = "isReachableViaWiFi") open external fun isReachableViaWiFi(): Boolean
        @ObjCMethod(bridge = "objcKniBridge380", selector = "localizedNetworkReachabilityStatusString") open external fun localizedNetworkReachabilityStatusString(): String
        @ObjCMethod(bridge = "objcKniBridge384", selector = "networkReachabilityStatus") open external fun networkReachabilityStatus(): AFNetworkReachabilityStatus /* = Long */
        @ObjCMethod(bridge = "objcKniBridge382", selector = "setReachabilityStatusChangeBlock:") open external fun setReachabilityStatusChangeBlock(block: ((AFNetworkReachabilityStatus /* = Long */) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge376", selector = "startMonitoring") open external fun startMonitoring()
        @ObjCMethod(bridge = "objcKniBridge378", selector = "stopMonitoring") open external fun stopMonitoring()
        companion object : AFNetworkReachabilityManagerMeta, ObjCClassOf<AFNetworkReachabilityManager>
    }

    @ExternalObjCClass open class AFNetworkReachabilityManagerMeta : NSObjectMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge372", selector = "alloc") open external fun alloc(): AFNetworkReachabilityManager?
        @ObjCMethod(bridge = "objcKniBridge370", selector = "allocWithZone:") open external fun allocWithZone(zone: CPointer<_NSZone>?): AFNetworkReachabilityManager?
        @ObjCMethod(bridge = "objcKniBridge362", selector = "manager") open external fun manager(): AFNetworkReachabilityManager
        @ObjCMethod(bridge = "objcKniBridge366", selector = "managerForAddress:") open external fun managerForAddress(address: COpaquePointer? /* = CPointer<out CPointed>? */): AFNetworkReachabilityManager
        @ObjCMethod(bridge = "objcKniBridge364", selector = "managerForDomain:") open external fun managerForDomain(domain: String): AFNetworkReachabilityManager
        @ObjCMethod(bridge = "objcKniBridge368", selector = "new") open external fun new(): AFNetworkReachabilityManager?
        @ObjCMethod(bridge = "objcKniBridge360", selector = "sharedManager") open external fun sharedManager(): AFNetworkReachabilityManager
    }

    @ExternalObjCClass open class AFPropertyListRequestSerializer : AFHTTPRequestSerializer {
        @ObjCConstructor(designated = true, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var format: NSPropertyListFormat /* = Long */
        var writeOptions: NSPropertyListWriteOptions /* = Long */
        @ObjCMethod(bridge = "objcKniBridge308", selector = "format") open external fun format(): NSPropertyListFormat /* = Long */
        @ObjCMethod(bridge = "objcKniBridge316", selector = "init") external override fun init(): AFPropertyListRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge318", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFPropertyListRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge310", selector = "setFormat:") open external fun setFormat(format: NSPropertyListFormat /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge314", selector = "setWriteOptions:") open external fun setWriteOptions(writeOptions: NSPropertyListWriteOptions /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge312", selector = "writeOptions") open external fun writeOptions(): NSPropertyListWriteOptions /* = Long */
        companion object : AFPropertyListRequestSerializerMeta, ObjCClassOf<AFPropertyListRequestSerializer>
    }

    @ExternalObjCClass open class AFPropertyListRequestSerializerMeta : AFHTTPRequestSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge306", selector = "alloc") external override fun alloc(): AFPropertyListRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge304", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFPropertyListRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge302", selector = "new") external override fun new(): AFPropertyListRequestSerializer?
        @ObjCMethod(bridge = "objcKniBridge300", selector = "serializer") external override fun serializer(): AFPropertyListRequestSerializer
        @ObjCMethod(bridge = "objcKniBridge298", selector = "serializerWithFormat:writeOptions:") open external fun serializerWithFormat(format: NSPropertyListFormat /* = Long */, writeOptions: NSPropertyListWriteOptions /* = Long */): AFPropertyListRequestSerializer
    }

    @ExternalObjCClass open class AFPropertyListResponseSerializer : AFHTTPResponseSerializer {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var format: NSPropertyListFormat /* = Long */
        var readOptions: NSPropertyListReadOptions /* = Long */
        @ObjCMethod(bridge = "objcKniBridge132", selector = "format") open external fun format(): NSPropertyListFormat /* = Long */
        @ObjCMethod(bridge = "objcKniBridge140", selector = "init") external override fun init(): AFPropertyListResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge142", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFPropertyListResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge136", selector = "readOptions") open external fun readOptions(): NSPropertyListReadOptions /* = Long */
        @ObjCMethod(bridge = "objcKniBridge134", selector = "setFormat:") open external fun setFormat(format: NSPropertyListFormat /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge138", selector = "setReadOptions:") open external fun setReadOptions(readOptions: NSPropertyListReadOptions /* = Long */)
        companion object : AFPropertyListResponseSerializerMeta, ObjCClassOf<AFPropertyListResponseSerializer>
    }

    @ExternalObjCClass open class AFPropertyListResponseSerializerMeta : AFHTTPResponseSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge130", selector = "alloc") external override fun alloc(): AFPropertyListResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge128", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFPropertyListResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge126", selector = "new") external override fun new(): AFPropertyListResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge124", selector = "serializer") external override fun serializer(): AFPropertyListResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge122", selector = "serializerWithFormat:readOptions:") open external fun serializerWithFormat(format: NSPropertyListFormat /* = Long */, readOptions: NSPropertyListReadOptions /* = Long */): AFPropertyListResponseSerializer
    }

    enum class AFSSLPinningMode private constructor(value: NSUInteger /* = Long */) : Enum<AFSSLPinningMode>, CEnum {
        enum entry AFSSLPinningModeNone
        enum entry AFSSLPinningModePublicKey
        enum entry AFSSLPinningModeCertificate
        override val value: NSUInteger /* = Long */

        companion object {
            fun byValue(value: NSUInteger /* = Long */): AFSSLPinningMode
        }

        class Var constructor(rawPtr: NativePtr /* = NativePtr */) : CEnumVar {
            var value: AFSSLPinningMode
            companion object : CPrimitiveVar.Type
        }

    }

    @ExternalObjCClass open class AFSecurityPolicy : NSObject, NSSecureCodingProtocol, NSCopyingProtocol {
        @ObjCConstructor(designated = true, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        val SSLPinningMode: AFSSLPinningMode
        var allowInvalidCertificates: Boolean
        var pinnedCertificates: Set<*>?
        var validatesDomainName: Boolean
        @ObjCMethod(bridge = "objcKniBridge338", selector = "SSLPinningMode") open external fun SSLPinningMode(): AFSSLPinningMode
        @ObjCMethod(bridge = "objcKniBridge344", selector = "allowInvalidCertificates") open external fun allowInvalidCertificates(): Boolean
        @ObjCMethod(bridge = "objcKniBridge358", selector = "copyWithZone:") open external fun copyWithZone(zone: CPointer<NSZone /* = _NSZone */>?): Any
        @ObjCMethod(bridge = "objcKniBridge356", selector = "encodeWithCoder:") open external fun encodeWithCoder(aCoder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge336", selector = "evaluateServerTrust:forDomain:") open external fun evaluateServerTrust(serverTrust: SecTrustRef? /* = CPointer<__SecTrust>? */, forDomain: String?): Boolean
        @ObjCMethod(bridge = "objcKniBridge352", selector = "init") open external fun init(): AFSecurityPolicy?
        @ObjCMethod(bridge = "objcKniBridge354", selector = "initWithCoder:") open external fun initWithCoder(aDecoder: NSCoder): AFSecurityPolicy?
        @ObjCMethod(bridge = "objcKniBridge340", selector = "pinnedCertificates") open external fun pinnedCertificates(): Set<*>?
        @ObjCMethod(bridge = "objcKniBridge346", selector = "setAllowInvalidCertificates:") open external fun setAllowInvalidCertificates(allowInvalidCertificates: Boolean)
        @ObjCMethod(bridge = "objcKniBridge342", selector = "setPinnedCertificates:") open external fun setPinnedCertificates(pinnedCertificates: Set<*>?)
        @ObjCMethod(bridge = "objcKniBridge350", selector = "setValidatesDomainName:") open external fun setValidatesDomainName(validatesDomainName: Boolean)
        @ObjCMethod(bridge = "objcKniBridge348", selector = "validatesDomainName") open external fun validatesDomainName(): Boolean
        companion object : AFSecurityPolicyMeta, ObjCClassOf<AFSecurityPolicy>
    }

    @ExternalObjCClass open class AFSecurityPolicyMeta : NSObjectMeta, NSSecureCodingProtocolMeta, NSCopyingProtocolMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge332", selector = "alloc") open external fun alloc(): AFSecurityPolicy?
        @ObjCMethod(bridge = "objcKniBridge330", selector = "allocWithZone:") open external fun allocWithZone(zone: CPointer<_NSZone>?): AFSecurityPolicy?
        @ObjCMethod(bridge = "objcKniBridge320", selector = "certificatesInBundle:") open external fun certificatesInBundle(bundle: NSBundle): Set<*>
        @ObjCMethod(bridge = "objcKniBridge322", selector = "defaultPolicy") open external fun defaultPolicy(): AFSecurityPolicy
        @ObjCMethod(bridge = "objcKniBridge328", selector = "new") open external fun new(): AFSecurityPolicy?
        @ObjCMethod(bridge = "objcKniBridge324", selector = "policyWithPinningMode:") open external fun policyWithPinningMode(pinningMode: AFSSLPinningMode): AFSecurityPolicy
        @ObjCMethod(bridge = "objcKniBridge326", selector = "policyWithPinningMode:withPinnedCertificates:") open external fun policyWithPinningMode(pinningMode: AFSSLPinningMode, withPinnedCertificates: Set<*>): AFSecurityPolicy
        @ObjCMethod(bridge = "objcKniBridge334", selector = "supportsSecureCoding") open external fun supportsSecureCoding(): Boolean
    }

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking5") interface AFURLRequestSerializationProtocol : NSObjectProtocol, NSSecureCodingProtocol, NSCopyingProtocol {
        @ObjCMethod(bridge = "objcKniBridge9", selector = "initWithCoder:") fun initWithCoder(aDecoder: NSCoder): AFURLRequestSerializationProtocol?
        @ObjCMethod(bridge = "objcKniBridge7", selector = "requestBySerializingRequest:withParameters:error:") fun requestBySerializingRequest(request: NSURLRequest, withParameters: Any?, error: CPointer<ObjCObjectVar<NSError?>>?): NSURLRequest?
    }

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking5") interface AFURLRequestSerializationProtocolMeta : NSObjectProtocolMeta, NSSecureCodingProtocolMeta, NSCopyingProtocolMeta

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking0") interface AFURLResponseSerializationProtocol : NSObjectProtocol, NSSecureCodingProtocol, NSCopyingProtocol {
        @ObjCMethod(bridge = "objcKniBridge4", selector = "initWithCoder:") fun initWithCoder(aDecoder: NSCoder): AFURLResponseSerializationProtocol?
        @ObjCMethod(bridge = "objcKniBridge2", selector = "responseObjectForResponse:data:error:") fun responseObjectForResponse(response: NSURLResponse?, data: NSData?, error: CPointer<ObjCObjectVar<NSError?>>?): Any?
    }

    @ExternalObjCClass(protocolGetter = "kniprot_framework_afnetworking0") interface AFURLResponseSerializationProtocolMeta : NSObjectProtocolMeta, NSSecureCodingProtocolMeta, NSCopyingProtocolMeta

    @ExternalObjCClass open class AFURLSessionManager : NSObject, NSURLSessionDelegateProtocol, NSURLSessionTaskDelegateProtocol, NSURLSessionDataDelegateProtocol, NSURLSessionDownloadDelegateProtocol, NSSecureCodingProtocol, NSCopyingProtocol {
        @ObjCConstructor(designated = true, initSelector = "initWithSessionConfiguration:") constructor(sessionConfiguration: NSURLSessionConfiguration?)
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        var attemptsToRecreateUploadTasksForBackgroundSessions: Boolean
        var completionGroup: dispatch_group_t? /* = NSObject? */
        var completionQueue: dispatch_queue_t? /* = NSObject? */
        val dataTasks: List<*>
        val downloadTasks: List<*>
        val operationQueue: NSOperationQueue
        var reachabilityManager: AFNetworkReachabilityManager
        var responseSerializer: AFURLResponseSerializationProtocol
        var securityPolicy: AFSecurityPolicy
        val session: NSURLSession
        val tasks: List<*>
        val uploadTasks: List<*>
        @ObjCMethod(bridge = "objcKniBridge528", selector = "URLSession:didBecomeInvalidWithError:") open external fun URLSession(session: NSURLSession, didBecomeInvalidWithError: NSError?)
        @ObjCMethod(bridge = "objcKniBridge530", selector = "URLSession:didReceiveChallenge:completionHandler:") open external fun URLSession(session: NSURLSession, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition /* = Long */, NSURLCredential?) -> Unit)
        @ObjCMethod(bridge = "objcKniBridge520", selector = "URLSession:downloadTask:didFinishDownloadingToURL:") open external fun URLSession(session: NSURLSession, downloadTask: NSURLSessionDownloadTask, didFinishDownloadingToURL: NSURL)
        @ObjCMethod(bridge = "objcKniBridge536", selector = "URLSession:taskIsWaitingForConnectivity:") open external fun URLSession(session: NSURLSession, taskIsWaitingForConnectivity: NSURLSessionTask)
        @ObjCMethod(bridge = "objcKniBridge542", selector = "URLSession:task:needNewBodyStream:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, needNewBodyStream: (NSInputStream?) -> Unit)
        @ObjCMethod(bridge = "objcKniBridge548", selector = "URLSession:task:didCompleteWithError:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError: NSError?)
        @ObjCMethod(bridge = "objcKniBridge538", selector = "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, willPerformHTTPRedirection: NSHTTPURLResponse, newRequest: NSURLRequest, completionHandler: (NSURLRequest?) -> Unit)
        @ObjCMethod(bridge = "objcKniBridge540", selector = "URLSession:task:didReceiveChallenge:completionHandler:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: (NSURLSessionAuthChallengeDisposition /* = Long */, NSURLCredential?) -> Unit)
        @ObjCMethod(bridge = "objcKniBridge534", selector = "URLSession:task:willBeginDelayedRequest:completionHandler:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, willBeginDelayedRequest: NSURLRequest, completionHandler: (NSURLSessionDelayedRequestDisposition /* = Long */, NSURLRequest?) -> Unit)
        @ObjCMethod(bridge = "objcKniBridge546", selector = "URLSession:task:didFinishCollectingMetrics:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, didFinishCollectingMetrics: NSURLSessionTaskMetrics)
        @ObjCMethod(bridge = "objcKniBridge544", selector = "URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:") open external fun URLSession(session: NSURLSession, task: NSURLSessionTask, didSendBodyData: int64_t /* = Long */, totalBytesSent: int64_t /* = Long */, totalBytesExpectedToSend: int64_t /* = Long */)
        @ObjCMethod(bridge = "objcKniBridge532", selector = "URLSessionDidFinishEventsForBackgroundURLSession:") open external fun URLSessionDidFinishEventsForBackgroundURLSession(session: NSURLSession)
        @ObjCMethod(bridge = "objcKniBridge486", selector = "attemptsToRecreateUploadTasksForBackgroundSessions") open external fun attemptsToRecreateUploadTasksForBackgroundSessions(): Boolean
        @ObjCMethod(bridge = "objcKniBridge496", selector = "class") open external fun `class`(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge482", selector = "completionGroup") open external fun completionGroup(): dispatch_group_t? /* = NSObject? */
        @ObjCMethod(bridge = "objcKniBridge478", selector = "completionQueue") open external fun completionQueue(): dispatch_queue_t? /* = NSObject? */
        @ObjCMethod(bridge = "objcKniBridge510", selector = "conformsToProtocol:") open external fun conformsToProtocol(aProtocol: Protocol?): Boolean
        @ObjCMethod(bridge = "objcKniBridge524", selector = "copyWithZone:") open external fun copyWithZone(zone: CPointer<NSZone /* = _NSZone */>?): Any
        @ObjCMethod(bridge = "objcKniBridge408", selector = "dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:") open external fun dataTaskWithRequest(request: NSURLRequest, uploadProgress: ((NSProgress?) -> Unit)?, downloadProgress: ((NSProgress?) -> Unit)?, completionHandler: ((NSURLResponse?, Any?, NSError?) -> Unit)?): NSURLSessionDataTask
        @ObjCMethod(bridge = "objcKniBridge406", selector = "dataTaskWithRequest:completionHandler:") open external fun dataTaskWithRequest(request: NSURLRequest, completionHandler: ((NSURLResponse?, Any?, NSError?) -> Unit)?): NSURLSessionDataTask
        @ObjCMethod(bridge = "objcKniBridge472", selector = "dataTasks") open external fun dataTasks(): List<*>
        @ObjCMethod(bridge = "objcKniBridge526", selector = "debugDescription") open external fun debugDescription(): String?
        @ObjCMethod(bridge = "objcKniBridge518", selector = "description") open external fun description(): String?
        @ObjCMethod(bridge = "objcKniBridge422", selector = "downloadProgressForTask:") open external fun downloadProgressForTask(task: NSURLSessionTask): NSProgress?
        @ObjCMethod(bridge = "objcKniBridge416", selector = "downloadTaskWithRequest:progress:destination:completionHandler:") open external fun downloadTaskWithRequest(request: NSURLRequest, progress: ((NSProgress?) -> Unit)?, destination: ((NSURL?, NSURLResponse?) -> NSURL?)?, completionHandler: ((NSURLResponse?, NSURL?, NSError?) -> Unit)?): NSURLSessionDownloadTask
        @ObjCMethod(bridge = "objcKniBridge418", selector = "downloadTaskWithResumeData:progress:destination:completionHandler:") open external fun downloadTaskWithResumeData(resumeData: NSData, progress: ((NSProgress?) -> Unit)?, destination: ((NSURL?, NSURLResponse?) -> NSURL?)?, completionHandler: ((NSURLResponse?, NSURL?, NSError?) -> Unit)?): NSURLSessionDownloadTask
        @ObjCMethod(bridge = "objcKniBridge476", selector = "downloadTasks") open external fun downloadTasks(): List<*>
        @ObjCMethod(bridge = "objcKniBridge522", selector = "encodeWithCoder:") open external fun encodeWithCoder(aCoder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge514", selector = "hash") open external fun hash(): NSUInteger /* = Long */
        @ObjCMethod(bridge = "objcKniBridge490", selector = "init") open external fun init(): AFURLSessionManager?
        @ObjCMethod(bridge = "objcKniBridge492", selector = "initWithCoder:") open external fun initWithCoder(aDecoder: NSCoder): AFURLSessionManager?
        @ObjCMethod(bridge = "objcKniBridge402", selector = "initWithSessionConfiguration:") open external fun initWithSessionConfiguration(configuration: NSURLSessionConfiguration?): AFURLSessionManager
        @ObjCMethod(bridge = "objcKniBridge404", selector = "invalidateSessionCancelingTasks:") open external fun invalidateSessionCancelingTasks(cancelPendingTasks: Boolean)
        @ObjCMethod(bridge = "objcKniBridge494", selector = "isEqual:") open external fun isEqual(`object`: Any?): Boolean
        @ObjCMethod(bridge = "objcKniBridge506", selector = "isKindOfClass:") open external fun isKindOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge508", selector = "isMemberOfClass:") open external fun isMemberOfClass(aClass: ObjCClass?): Boolean
        @ObjCMethod(bridge = "objcKniBridge504", selector = "isProxy") open external fun isProxy(): Boolean
        @ObjCMethod(bridge = "objcKniBridge456", selector = "operationQueue") open external fun operationQueue(): NSOperationQueue
        @ObjCMethod(bridge = "objcKniBridge498", selector = "performSelector:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Any?
        @ObjCMethod(bridge = "objcKniBridge500", selector = "performSelector:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge502", selector = "performSelector:withObject:withObject:") open external fun performSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */, withObject: Any?, _withObject: Any?): Any?
        @ObjCMethod(bridge = "objcKniBridge466", selector = "reachabilityManager") open external fun reachabilityManager(): AFNetworkReachabilityManager
        @ObjCMethod(bridge = "objcKniBridge512", selector = "respondsToSelector:") open external fun respondsToSelector(aSelector: COpaquePointer? /* = CPointer<out CPointed>? */): Boolean
        @ObjCMethod(bridge = "objcKniBridge458", selector = "responseSerializer") open external fun responseSerializer(): AFURLResponseSerializationProtocol
        @ObjCMethod(bridge = "objcKniBridge462", selector = "securityPolicy") open external fun securityPolicy(): AFSecurityPolicy
        @ObjCMethod(bridge = "objcKniBridge454", selector = "session") open external fun session(): NSURLSession
        @ObjCMethod(bridge = "objcKniBridge488", selector = "setAttemptsToRecreateUploadTasksForBackgroundSessions:") open external fun setAttemptsToRecreateUploadTasksForBackgroundSessions(attemptsToRecreateUploadTasksForBackgroundSessions: Boolean)
        @ObjCMethod(bridge = "objcKniBridge484", selector = "setCompletionGroup:") open external fun setCompletionGroup(completionGroup: dispatch_group_t? /* = NSObject? */)
        @ObjCMethod(bridge = "objcKniBridge480", selector = "setCompletionQueue:") open external fun setCompletionQueue(completionQueue: dispatch_queue_t? /* = NSObject? */)
        @ObjCMethod(bridge = "objcKniBridge440", selector = "setDataTaskDidBecomeDownloadTaskBlock:") open external fun setDataTaskDidBecomeDownloadTaskBlock(block: ((NSURLSession?, NSURLSessionDataTask?, NSURLSessionDownloadTask?) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge442", selector = "setDataTaskDidReceiveDataBlock:") open external fun setDataTaskDidReceiveDataBlock(block: ((NSURLSession?, NSURLSessionDataTask?, NSData?) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge438", selector = "setDataTaskDidReceiveResponseBlock:") open external fun setDataTaskDidReceiveResponseBlock(block: ((NSURLSession?, NSURLSessionDataTask?, NSURLResponse?) -> NSURLSessionResponseDisposition /* = Long */)?)
        @ObjCMethod(bridge = "objcKniBridge444", selector = "setDataTaskWillCacheResponseBlock:") open external fun setDataTaskWillCacheResponseBlock(block: ((NSURLSession?, NSURLSessionDataTask?, NSCachedURLResponse?) -> NSCachedURLResponse?)?)
        @ObjCMethod(bridge = "objcKniBridge446", selector = "setDidFinishEventsForBackgroundURLSessionBlock:") open external fun setDidFinishEventsForBackgroundURLSessionBlock(block: ((NSURLSession?) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge448", selector = "setDownloadTaskDidFinishDownloadingBlock:") open external fun setDownloadTaskDidFinishDownloadingBlock(block: ((NSURLSession?, NSURLSessionDownloadTask?, NSURL?) -> NSURL?)?)
        @ObjCMethod(bridge = "objcKniBridge452", selector = "setDownloadTaskDidResumeBlock:") open external fun setDownloadTaskDidResumeBlock(block: ((NSURLSession?, NSURLSessionDownloadTask?, int64_t /* = Long */, int64_t /* = Long */) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge450", selector = "setDownloadTaskDidWriteDataBlock:") open external fun setDownloadTaskDidWriteDataBlock(block: ((NSURLSession?, NSURLSessionDownloadTask?, int64_t /* = Long */, int64_t /* = Long */, int64_t /* = Long */) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge468", selector = "setReachabilityManager:") open external fun setReachabilityManager(reachabilityManager: AFNetworkReachabilityManager)
        @ObjCMethod(bridge = "objcKniBridge460", selector = "setResponseSerializer:") open external fun setResponseSerializer(responseSerializer: AFURLResponseSerializationProtocol)
        @ObjCMethod(bridge = "objcKniBridge464", selector = "setSecurityPolicy:") open external fun setSecurityPolicy(securityPolicy: AFSecurityPolicy)
        @ObjCMethod(bridge = "objcKniBridge424", selector = "setSessionDidBecomeInvalidBlock:") open external fun setSessionDidBecomeInvalidBlock(block: ((NSURLSession?, NSError?) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge426", selector = "setSessionDidReceiveAuthenticationChallengeBlock:") open external fun setSessionDidReceiveAuthenticationChallengeBlock(block: ((NSURLSession?, NSURLAuthenticationChallenge?, CPointer<ObjCObjectVar<NSURLCredential?>>?) -> NSURLSessionAuthChallengeDisposition /* = Long */)?)
        @ObjCMethod(bridge = "objcKniBridge436", selector = "setTaskDidCompleteBlock:") open external fun setTaskDidCompleteBlock(block: ((NSURLSession?, NSURLSessionTask?, NSError?) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge432", selector = "setTaskDidReceiveAuthenticationChallengeBlock:") open external fun setTaskDidReceiveAuthenticationChallengeBlock(block: ((NSURLSession?, NSURLSessionTask?, NSURLAuthenticationChallenge?, CPointer<ObjCObjectVar<NSURLCredential?>>?) -> NSURLSessionAuthChallengeDisposition /* = Long */)?)
        @ObjCMethod(bridge = "objcKniBridge434", selector = "setTaskDidSendBodyDataBlock:") open external fun setTaskDidSendBodyDataBlock(block: ((NSURLSession?, NSURLSessionTask?, int64_t /* = Long */, int64_t /* = Long */, int64_t /* = Long */) -> Unit)?)
        @ObjCMethod(bridge = "objcKniBridge428", selector = "setTaskNeedNewBodyStreamBlock:") open external fun setTaskNeedNewBodyStreamBlock(block: ((NSURLSession?, NSURLSessionTask?) -> NSInputStream?)?)
        @ObjCMethod(bridge = "objcKniBridge430", selector = "setTaskWillPerformHTTPRedirectionBlock:") open external fun setTaskWillPerformHTTPRedirectionBlock(block: ((NSURLSession?, NSURLSessionTask?, NSURLResponse?, NSURLRequest?) -> NSURLRequest?)?)
        @ObjCMethod(bridge = "objcKniBridge516", selector = "superclass") open external fun superclass(): ObjCClass?
        @ObjCMethod(bridge = "objcKniBridge470", selector = "tasks") open external fun tasks(): List<*>
        @ObjCMethod(bridge = "objcKniBridge420", selector = "uploadProgressForTask:") open external fun uploadProgressForTask(task: NSURLSessionTask): NSProgress?
        @ObjCMethod(bridge = "objcKniBridge412", selector = "uploadTaskWithRequest:fromData:progress:completionHandler:") open external fun uploadTaskWithRequest(request: NSURLRequest, fromData: NSData?, progress: ((NSProgress?) -> Unit)?, completionHandler: ((NSURLResponse?, Any?, NSError?) -> Unit)?): NSURLSessionUploadTask
        @ObjCMethod(bridge = "objcKniBridge410", selector = "uploadTaskWithRequest:fromFile:progress:completionHandler:") open external fun uploadTaskWithRequest(request: NSURLRequest, fromFile: NSURL, progress: ((NSProgress?) -> Unit)?, completionHandler: ((NSURLResponse?, Any?, NSError?) -> Unit)?): NSURLSessionUploadTask
        @ObjCMethod(bridge = "objcKniBridge414", selector = "uploadTaskWithStreamedRequest:progress:completionHandler:") open external fun uploadTaskWithStreamedRequest(request: NSURLRequest, progress: ((NSProgress?) -> Unit)?, completionHandler: ((NSURLResponse?, Any?, NSError?) -> Unit)?): NSURLSessionUploadTask
        @ObjCMethod(bridge = "objcKniBridge474", selector = "uploadTasks") open external fun uploadTasks(): List<*>
        companion object : AFURLSessionManagerMeta, ObjCClassOf<AFURLSessionManager>
    }

    @ExternalObjCClass open class AFURLSessionManagerMeta : NSObjectMeta, NSURLSessionDelegateProtocolMeta, NSURLSessionTaskDelegateProtocolMeta, NSURLSessionDataDelegateProtocolMeta, NSURLSessionDownloadDelegateProtocolMeta, NSSecureCodingProtocolMeta, NSCopyingProtocolMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge398", selector = "alloc") open external fun alloc(): AFURLSessionManager?
        @ObjCMethod(bridge = "objcKniBridge396", selector = "allocWithZone:") open external fun allocWithZone(zone: CPointer<_NSZone>?): AFURLSessionManager?
        @ObjCMethod(bridge = "objcKniBridge394", selector = "new") open external fun new(): AFURLSessionManager?
        @ObjCMethod(bridge = "objcKniBridge400", selector = "supportsSecureCoding") open external fun supportsSecureCoding(): Boolean
    }

    @ExternalObjCClass open class AFXMLParserResponseSerializer : AFHTTPResponseSerializer {
        @ObjCConstructor(designated = false, initSelector = "init") constructor()
        @ObjCConstructor(designated = false, initSelector = "initWithCoder:") constructor(coder: NSCoder)
        @ObjCMethod(bridge = "objcKniBridge118", selector = "init") external override fun init(): AFXMLParserResponseSerializer
        @ObjCMethod(bridge = "objcKniBridge120", selector = "initWithCoder:") external override fun initWithCoder(aDecoder: NSCoder): AFXMLParserResponseSerializer?
        companion object : AFXMLParserResponseSerializerMeta, ObjCClassOf<AFXMLParserResponseSerializer>
    }

    @ExternalObjCClass open class AFXMLParserResponseSerializerMeta : AFHTTPResponseSerializerMeta {
        protected constructor()
        @ObjCMethod(bridge = "objcKniBridge116", selector = "alloc") external override fun alloc(): AFXMLParserResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge114", selector = "allocWithZone:") external override fun allocWithZone(zone: CPointer<_NSZone>?): AFXMLParserResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge112", selector = "new") external override fun new(): AFXMLParserResponseSerializer?
        @ObjCMethod(bridge = "objcKniBridge110", selector = "serializer") external override fun serializer(): AFXMLParserResponseSerializer
    }

}
michalchudziak commented 6 years ago

Maybe it's a problem with Alamofire itself. I'm not sure how well it plays with Obj-C

olonho commented 6 years ago

Not sure what is exact problem in Kotlin/Native here. CocoaPods in general not yet supported in Gradle plugin, but we are considering implementing it.

michalchudziak commented 6 years ago

@olonho Any ETA on this? I think it might make framework more usable for the larger audience.

ildarsharafutdinov commented 6 years ago

As far as I understand the issue is caused by the fact kotlin native doesn't support pure swift. So unless Alamofire becomes compatible with obj-c, it's impossible to use it with kotlin.

SvyatoslavScherbina commented 4 years ago

CocoaPods integration was implemented some time ago, and got significants improvements in 1.4. Please refer to the documentation: https://kotlinlang.org/docs/reference/native/cocoapods.html