hello! i try update my multiplatform (android &amp...
# kotlin-native
a
hello! i try update my multiplatform (android & ios) module from 0.8 kotlin/native to 0.9.2 with kotlin 1.3 RC and now compilation failed with:
Copy code
Undefined symbols for architecture x86_64:
  "_kfun:platform.darwin.objcKniBridge77$darwin(kotlin.native.internal.NativePtr;kotlin.native.internal.NativePtr)platform.darwin.NSObject?", referenced from:
      _kfun:io.ktor.client.engine.ios.IosClientEngine.$execute$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
  "_private_functions_<ktor-http-ios>_kfun:io.ktor.http.HttpStatusCode.equals(kotlin.Any?)ValueType_57", referenced from:
      _kfun:com.mirbega.russiarunning.network.LiveEventsApi.$processResponse$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
ld: symbol(s) not found for architecture x86_64
used versions is:
Copy code
kotlin_version = '1.3.0-rc-57'
    kotlin_native_version = '0.9.2'
    coroutines_version = '0.26.1-eap13'
    serialization_version = '0.8.1-rc13'
    ktor_version = '0.9.5-rc13'
anybody get same problem? or know how to fix?
o
Likely your ktor was compiled with different platform libs than you have got
s
cc @e5l
e
Could you clean gradle cache and try again?
a
Yes, already try it
And try new alpha too 0.9.6-alpha-1-rc13
i can success compile ios framework on versions:
Copy code
kotlin_version = '1.3.0-rc-57'
    kotlin_native_version = '0.9.2'
    coroutines_version = '0.26.1-rc-conf2'
    serialization_version = '0.8.1-rc13'
    ktor_version = '0.9.5-rc13-conf2'
and without usage of HttpStatusCode of ktor
i comment this code:
Copy code
return when (response.status) {
            HttpStatusCode.OK -> {
                parser(responseJson)
            }
            HttpStatusCode.Unauthorized -> {
                val message = responseJson.jsonObject.getObject("error").getPrimitive("error_message").content
                throw UnAuthorizedException(message)
            }
            else -> {
                val message = responseJson.jsonObject.getObject("error").getPrimitiveOrNull("error_message")?.contentOrNull
                if (message != null) throw HttpErrorException(message)
                val errorJSON = responseJson.jsonObject.getObject("error")
                        .getObjectOrNull("error_message")
                val parsedJsonError = parseJsonError(errorJSON?.toString() ?: "")
                throw HttpErrorException(parsedJsonError ?: "")
            }
        }
and compilation success. but without commenting i got error:
Copy code
Undefined symbols for architecture x86_64:
  "_private_classes_<ktor-http-ios>_io.ktor.http.HttpStatusCode_56", referenced from:
      _kfun:com.mirbega.russiarunning.network.LiveEventsApi.$processResponse$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
  "_private_functions_<ktor-http-ios>_kfun:io.ktor.http.HttpStatusCode.equals(kotlin.Any?)ValueType_57", referenced from:
      _kfun:com.mirbega.russiarunning.network.LiveEventsApi.$processResponse$3.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? in combined.o
ld: symbol(s) not found for architecture x86_64
and when i rewrite code without usage Companion object of HttpStatusCode, framework also compile success. with this code:
Copy code
return if(response.status.isSuccess()) {
            parser(responseJson)
        } else {
            val message = responseJson.jsonObject.getObject("error").getPrimitiveOrNull("error_message")?.contentOrNull
            if (message != null) throw HttpErrorException(message)
            val errorJSON = responseJson.jsonObject.getObject("error")
                    .getObjectOrNull("error_message")
            val parsedJsonError = parseJsonError(errorJSON?.toString() ?: "")
            throw HttpErrorException(parsedJsonError ?: "")
        }