rjhdby
12/29/2018, 10:44 AMexpect
function?
For example, Drawable
for android and UIImage
for ios?kpgalligan
12/29/2018, 4:34 PMRobert
12/29/2018, 9:12 PMLinkedList<E>
(from Java), but what Kotlin list should I extend? ArrayList
is final, so can't use that, and just List
makes me implement every method myself 😞 extending MutableList
is even worse....Dhanapal
01/02/2019, 5:57 AMjlleitschuh
01/03/2019, 11:59 PMsashjakk
01/04/2019, 12:10 PMkotlin.TypeCastException
🤨
Common part:
@Serializable
data class Post(
val userId: Long,
val id: Long,
val title: String,
val body: String
)
class KtorClient : CoroutineScope {
private val httpClient = HttpClient()
override val coroutineContext: CoroutineContext
get() = Job()
fun getPosts(callback: (String, Throwable?) -> Unit) {
launch {
try {
val raw = httpClient.get<String> {
url("<https://jsonplaceholder.typicode.com/posts>")
}
println(raw)
callback(raw, null)
} catch (e: Throwable) {
callback("", e)
}
}
}
}
iOS part:
let client = KtorClient()
client.getPosts { (posts: String, error: KotlinThrowable?) -> KotlinUnit in
if (error != nil) {
error?.printStackTrace()
print(error?.cause ?? "oups")
print(error?.message ?? "oups")
return KotlinUnit()
}
print(posts)
return KotlinUnit()
}
aljosa
01/04/2019, 3:14 PMcoletz
01/04/2019, 5:13 PMOleg Yukhnevich
01/04/2019, 8:59 PMAndrey Gromov
01/07/2019, 8:11 AMWillis
01/08/2019, 12:22 PMUnresolved reference: mockK
error when building/executing the test even if InteliJ autocompletion finds the library without any problem 😕Dominaezzz
01/08/2019, 6:24 PMkotlin.targets.mingw.compilations.main.getBinary('EXECUTABLE', buildType)
to get the binary for execution. What is the jvm equivalent? kotlin.targets.jvm.compilations.main.getJar('EXECUTABLE', buildType)
doesn't work 🙂.kpgalligan
01/08/2019, 7:28 PMbdeg
01/09/2019, 9:06 AMqlitzler
01/09/2019, 1:37 PMandroidMain
and helper
. I'd like for helper
to have a dependency on androidMain
, but I can't figure out how to make the usual implementation project(':main')
work. I keep geeting this error: roject with path ':main' could not be found in root project 'instantsearch-kotlin'.
I've read this paragraph on the website but that didn't really help. https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#disambiguating-targets.
Any help would be greatly appreciated !pandawarrior
01/10/2019, 6:00 AMiosMain/kotlin
. How should I go about it?
kotlin {
targets {
fromPreset(presets.android, ‘android’)
fromPreset(presets.iosArm64, ‘ios’) {
compilations.main.outputKinds(‘FRAMEWORK’)
}
}alexfacciorusso
01/10/2019, 10:15 AMalexfacciorusso
01/10/2019, 5:17 PMkpgalligan
01/11/2019, 2:23 PMkpgalligan
01/11/2019, 2:26 PMDico
01/11/2019, 3:19 PMimplementation(fileTree("$directoryJre/lib/ext"))
which makes them show up in the gradle view of intellij, but it does not work.
The same goes for other java dependencies I add in the common source set.
It would be useful to be able to configure a multiplatform project as jvm-only, allowing java dependencies as well as the JRE to be accessed from the common source.
I have a few use cases where the ability to use expect/actual declarations would be invaluable, and I'm sure that there would be more:
• I have a project that I would like to implement as an external process or injected dll
• Any project targeting one of a set of libraries per build, for example, minecraft server plugins that support multiple server platforms (bukkit, nukkit, sponge, glowstone)
If something like this is already possible using some workaround, please do let me know.basher
01/11/2019, 6:32 PMhallvard
01/11/2019, 10:54 PMCyrille QUÉMIN
01/12/2019, 6:16 PMDico
01/13/2019, 8:37 PMkotlin-gradle-plugin:1.3.11
as a dependency.
The same version of the plugin is applied to the whole project.
When building, I get the following error:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':client-shared:compileKotlinJvm'.
Caused by: java.lang.NoSuchMethodError: org.jetbrains.kotlin.incremental.BuildUtilKt.makeModuleFile(Ljava/lang/String;ZLjava/io/File;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/io/File;
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.runJvmCompiler(GradleKotlinCompilerRunner.kt:102)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:405)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:309)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:270)
<12 hidden>
... 29 more
Robert
01/15/2019, 9:27 AMHauke Radtki
01/15/2019, 12:33 PMRak
01/15/2019, 1:50 PMalexfacciorusso
01/15/2019, 3:06 PMdispatch_queue
dispatcher that takes a native dispatch queue and calls a dispatch_async()
on it.
The tutorials I’ve seen, though, they use the same dispatch queue for running every operation (the main dispatch queue). Indeed if I try to create a new dispatch queue for network (a new thread), it says it can’t run stuff in it because it can’t use a “non blocked or shared object” on a different thread.
Questions:
1. Is there a way to create two threads for two dispatchers and use them with coroutines in Kotlin MPP (I think not, since I’m seeing that there’s an issue filed for it);
2. How bad is running network and UI in the same thread but asyncronously?
3. Are there some limitations for this?thevery
01/15/2019, 4:52 PMthevery
01/15/2019, 4:52 PMkpgalligan
01/15/2019, 7:45 PMthevery
01/15/2019, 8:11 PMrusshwolf
01/15/2019, 9:19 PMalec
01/15/2019, 11:20 PM