kotlin multiplatform – floating errors on ios gadgets “A server with the desired hostname couldn’t be discovered”

0
37


A multiplatform venture has an error:

"Error Area=KotlinException Code=0 "Exception in http request: Error Area=NSURLErrorDomain Code=-1003 "A server with the desired hostname couldn't be discovered." UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x28052d1d0 {Error Area=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=glad (Path is glad), interface: pdp_ip0, ipv4, dns, costly, _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>
), NSLocalizedDescription=A server with the desired hostname couldn't be discovered., NSErrorFailingURLStringKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, NSErrorFailingURLKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, _kCFStreamErrorDomainKey=12}" UserInfo={NSLocalizedDescription=Exception in http request: Error Area=NSURLErrorDomain Code=-1003 "A server with the desired hostname couldn't be discovered." UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x28052d1d0 {Error Area=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=glad (Path is glad), interface: pdp_ip0, ipv4, dns, costly, _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
   LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>
), NSLocalizedDescription=A server with the desired hostname couldn't be discovered., NSErrorFailingURLStringKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, NSErrorFailingURLKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, _kCFStreamErrorDomainKey=12}, KotlinException=io.ktor.consumer.engine.darwin.DarwinHttpRequestException: Exception in http request: Error Area=NSURLErrorDomain Code=-1003 "A server with the desired hostname couldn't be discovered." UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x28052d1d0 {Error Area=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=glad (Path is glad), interface: pdp_ip0, ipv4, dns, costly, _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    LocalDataTask <D1AC7328-3E88-40AE-B432-D8ED35C4DED8>.<1>
), NSLocalizedDescription=A server with the desired hostname couldn't be discovered., NSErrorFailingURLStringKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, NSErrorFailingURLKey=https://oneclick.tmweb.ru/medhelp_main/v1/login, _kCFStreamErrorDomainKey=12}, KotlinExceptionOrigin=}"

There’s a reference to Web suppliers (somebody has no issues, and somebody consistently will get them), however different functions on the cellphone work positive

Initialization and request

enjoyable getHttpClient(): HttpClient{

    val httpClient1 = HttpClient(){

set up(ContentNegotiation) {

            json(kotlinx.serialization.json.Json {

ignoreUnknownKeys = true

            })

        }

set up(HttpTimeout) {

requestTimeoutMillis = 60000

            connectTimeoutMillis = 60000

            socketTimeoutMillis = 60000

        }

}

return httpClient1

}

@Throws(Exception::class)  droop enjoyable doLoginApiCall(signature: String, username: String, password: String): UserList {

    val resp : UserList = getHttpClient().use**{** consumer ->

consumer.put up(BASE_URL_LOCAL + "login") {

headers {

append(AUTH, LocalEndPoint.API_KEY)

            }

val tmp = MultiPartFormDataContent(formData {

append(USERNAME, username)

                append(PASSWORD, password)

                append(HASH, signature)

            })

            setBody(tmp)

        }

.physique()

    }

return resp

}

Name in from iOS


sdk.doLoginApiCall(signature: sig ,username: login!, password:cross!, completionHandler: { response, error in

                if let res : UserList = response {

                } else {

                }

            })

How can I eliminate this error

Apparently as a consequence of the truth that the venture doesn’t embody a Mac model, the sandbox is hidden. Registered outgoing connections within the entitlements file