KMM iOS mismatch type ChallengeHandler

Viewed 22
Type mismatch: inferred type is ChallengeHandler /* = (NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition /* = Long */, NSURLCredential?) -> Unit) -> Unit */ but ChallengeHandler /* = (NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, (NSURLSessionAuthChallengeDisposition /* = Int */, NSURLCredential?) -> Unit) -> Unit */ was expected

Basically above error logs happen when migrate to latest client ktor 2.0.3 and using kotlin 1.7.10.

Is this a bug from ktor? how can we deal with this issue? should we just postponed update latest ktor until this issue fixed?

I think platform.darwin.NSInteger is recognized as Long, thus it got mismatch. when you search inside NSURLSessionAuthChallengeDisposition this is platform.darwin.NSInteger but somehow IDE recognized as Long not Int, so I guess this is a bug? Run the build also failure by same error above

Can't do anything. tried to create extension to use Int, still same.. Tried to cast manually to Int also still error.

Can't build too because of this error.

Anyone have solutions?

enter image description here

0 Answers
Related