nestserau
12/17/2018, 9:59 AMkotlin.ClassCastException: null cannot be cast to io.ktor.client.call.HttpClientCall
at 0 test.kexe 0x000000010f30b976 kfun:kotlin.Exception.<init>(kotlin.String?)kotlin.Exception + 70
at 1 test.kexe 0x000000010f30b896 kfun:kotlin.RuntimeException.<init>(kotlin.String?)kotlin.RuntimeException + 70
at 2 test.kexe 0x000000010f3a8206 kfun:kotlin.ClassCastException.<init>(kotlin.String?)kotlin.ClassCastException + 70
at 3 test.kexe 0x000000010f3b2cfb ThrowClassCastException + 379
at 4 test.kexe 0x000000010f3dcb23 CheckInstance + 67
at 5 test.kexe 0x000000010f4e5706 kfun:io.ktor.client.HttpClient.$execute$COROUTINE$1.invokeSuspend(kotlin.Result<kotlin.Any?>)kotlin.Any? + 422
at 6 test.kexe 0x000000010f4e5802 kfun:io.ktor.client.HttpClient.execute(io.ktor.client.request.HttpRequestBuilder)io.ktor.client.call.HttpClientCall + 130
...
I’ve read earlier in this channel that it can be related to the version of Kotlin that I’m using (1.3.11), but the problem is, I cannot switch to 1.3.10 easily, because if I do, then it starts complaining about platform.CoreCrypto
not being available.
Does anyone know for sure that this error is related to Kotlin version or something else?
How I use HttpClient
is very simple:
suspend fun <T> send(message: MessageStrategy<T>): MessageResult<T> {
val request = message.buildRequest()
val token = session.state.sessionKey
...
val call = client.call(session.host) {
method = <http://HttpMethod.Post|HttpMethod.Post>
body = {
val encodedMessage = request.record.encode()
val bytes = ByteArray(encodedMessage.size) { encodedMessage[it].toByte() }
ByteArrayContent(bytes)
}
}
...
return ...
}
}
darkmoon_uk
12/17/2018, 2:13 PMIn the old model, common and platform-specific code needed to be placed in separate modules, linked by expectedBy dependencies. Now, common and platform-specific code is placed in different source roots of the same module, making projects easier to configure....is that mandatory to follow now? All platforms being in the same module sounds like an unpleasantly tightly coupled workflow.
darkmoon_uk
12/17/2018, 3:14 PMUIViewController
in Kotlin and have it conform to a Kotlin interface (an MVP 'View contract'). This is critical to implement the MVP UI pattern.
Attempting hits the error "Mixing Kotlin and Objective-C super-types is not supported".
Very unexpected and critical limitation of Kotlin/iOS 😞
Any ideas if this is likely to change in the future?
For now considering creating an inline-class wrapper to fake 'implement' the ViewContract. Others doing similar?pandawarrior
12/18/2018, 4:52 AMspierce7
12/18/2018, 6:37 AMunixer
12/18/2018, 1:08 PMunixer
12/18/2018, 1:10 PMJoakimForslund
12/18/2018, 3:11 PMTaras Koshkin
12/19/2018, 12:05 AMnestserau
12/19/2018, 11:10 AMpandawarrior
12/19/2018, 11:48 AMkapt
is not working properly.Ivan
12/19/2018, 6:05 PMBhattachar
12/19/2018, 7:08 PMaltavir
12/20/2018, 7:33 AMpajatopmr
12/20/2018, 7:34 AMnestserau
12/20/2018, 10:53 AMval result = backend.send(LoginMessageStrategy(login))
assertTrue(result is MessageResult.ok<SessionState>, "$result")
val sessionState = (result as MessageResult.ok<SessionState>).value
So the IDE complains about the “redundant” cast after assertTrue
, but if I remove it, then the unit test fails for iOS with an exception saying value
not found on result
, so I have to keep it there and let the IDE and the compiler complain, but at least it works for both platforms!
If there is a better place to report MPP issues, please let me know.rockerhieu
12/21/2018, 10:43 AMkotlin-multiplatform
. I can import java dependencies and compile the project just fine. But Android Studio/Intellij failed to recognized the these dependencies. Is anyone running into the same issue?itnoles
12/22/2018, 4:33 AMandreasmattsson
12/23/2018, 11:28 AMexpected
annotation class for a common module, in order to in the jvm module write actual typealias Headers = retrofit2.http.Headers
?
Where the actual implementation is the following:
https://github.com/square/retrofit/blob/master/retrofit/src/main/java/retrofit2/http/Headers.java
I've tried a whole bunch of variations on vararg val value: String
and val value: Array<String>
but it seems regardless I get some variation on the error The following declaration is incompatible because return type is different
?Dominaezzz
12/23/2018, 2:35 PMCreateProcess error=206, The filename or extension is too long
when I build mingw part of multiplatform project but JVM builds fine.egorand
12/24/2018, 2:17 AMkotlin {
targets {
fromPresets(presets.jvm, 'jvm') {
configurations {
baseline
}
}
}
jvmMain {
dependencies {
baseline 'com.squareup.okio:okio:1.14.1'
}
}
}
Nikolai
12/25/2018, 10:39 AMRobert
12/26/2018, 9:22 AMInetAddresses
, but it is not compatible.russhwolf
12/26/2018, 8:30 PMexpect class
is implicitly also an expect
declaration. So I think you’d need to leave it undefined and implement it as an actual
. Or you might be able to do it as an extension property on BigInteger.Companion
if you don’t want to define it for each platform.Robert
12/26/2018, 8:57 PMrrader
12/27/2018, 12:55 PMundefined
value, what is equivalent in Kotlin?Sergio Casero
12/28/2018, 11:51 AMgradlew desktop:run
(application plugin) works
-> run with tornado build config
not working
-> run with main method
not working
The issue for both is Could not find or load main class MainKt
Looks like I'm not alone, because this user also gets the issue -> https://stackoverflow.com/questions/48777697/kotlin-multi-platform-error-could-not-find-or-load-main-class-mainktjotaramirez
12/28/2018, 5:06 PMserebit
12/29/2018, 4:24 AMpajatopmr
12/29/2018, 8:53 AM