pardom
04/09/2019, 7:26 PMNikolai
04/10/2019, 4:48 AMTobi
04/10/2019, 7:30 AMByteArray
representation of a String
, but just realised that String.toByteArray()
(https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-byte-array.html) is just available on the jvm 😞
Any suggestion how I can do this in the common part?ribesg
04/10/2019, 8:29 AMmatej
04/10/2019, 2:54 PMpresets.android
target preset with the project structure as they describe it at https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html?
I would have to apply the com.android.application
plugin in the build.gradle inside SharedCode, but that's no good because then Android Studio starts expecting to find an AndroidManifest file there etc. etc.matej
04/10/2019, 3:23 PMAndroid
😄 which nicely circumvents having to deal with all of that but can lead to quite some confusion as you say. I guess we just have to live with the fact that for now a lot of things are in flux and documentation is lacking, but it is improving constantly.Dennis L
04/10/2019, 7:00 PMyshrsmz
04/11/2019, 2:29 AMfun calculate():Int
in Util.kt
, We have to call it like UtilKt.calculate()
in Swift but I want Util.calculate()
.
In jvm we have @JvmName
, but in native I can't find the equivalentLawik
04/11/2019, 8:09 AMNikolai
04/11/2019, 10:03 AMLawik
04/11/2019, 11:04 AMgalex
04/12/2019, 6:22 AMpublic abstract class ViewModel {
protected void onCleared() {
}
}
I hoped the following would work:
expect abstract class ViewModel {
protected fun onCleared()
}
And on Android declare it this way:
actual typealias ViewModel = androidx.lifecycle.ViewModel
But because protected means different things in Kotlin and Java, I get the following error: protected final expect fun onCleared(): Unit
is incompatible because visibility is different from protected/*protected and package*/ open fun onCleared(): Unit
. Am I stuck here or is there a way to go around this?Riccardo Montagnin
04/12/2019, 7:43 AMmetadata
and kotlinMultiplatform
. Which one should I publish with with name?
Thanks in advancelouiscad
04/12/2019, 1:12 PMenableFeaturePreview("GRADLE_METADATA")
still needed for Multiplatform projects on Gradle 5.3.1, where gradle metadata is stable?Icaro Temponi
04/12/2019, 2:54 PMHauke Radtki
04/12/2019, 3:00 PMCasey Brooks
04/12/2019, 3:38 PM@ThreadLocal
on the companion object and @SharedImmutable
on the value to be initialized once. But that @ThreadLocal
annotation makes me think that another thread might try to access the shared object and have it not be there, does the @SharedImmutable
mean that each thread-local companion object will reference the same API key after initialization? Here’s basically what I’ve got class SingletonConfiguration
private constructor(
val apiKey: String
) {
@ThreadLocal
companion object {
@SharedImmutable
lateinit var instance: SingletonConfiguration
fun init(apiKey: String) : SingletonConfiguration {
instance = SingletonConfiguration(apiKey)
return instance
}
}
}
Dennis L
04/14/2019, 5:44 PMrusshwolf
04/14/2019, 6:09 PMTobi
04/14/2019, 8:14 PMbasher
04/14/2019, 9:43 PMcom.android.library
plugin) in my mpp project:
kotlin {
targets {
targetFromPreset(presets.android, 'android') {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
}
}
Saying it can't find the main
method for compilations. is there somewhere else I should be setting the JVM target?Steven
04/15/2019, 2:48 PMczuckie
04/15/2019, 7:44 PMKaden Wilkinson
04/15/2019, 8:27 PMclasspath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version
and my app does as well. Fails with
Plugin request for plugin already on the classpath must not include a version
Kris Wong
04/15/2019, 9:37 PMNikky
04/16/2019, 3:32 AMapplication
and ShadowJar for packing the jvm target ?ribesg
04/16/2019, 8:27 AMexpect
function I get the Boolean literal argument without parameter name
warning, but named arguments are not allowed for members of expected classesDmitry Motyl
04/16/2019, 11:56 AMJoakimForslund
04/16/2019, 1:16 PMprintln("DEVICE: ${project.findProperty("kotlin.native.cocoapods.target")}")
and
println("DEVICE: ${project.findProperty("device")}")
returns null in the build script, is this because me using kotlin script instead of groovy now?Dmitry Motyl
04/16/2019, 3:38 PMDmitry Motyl
04/16/2019, 3:38 PMr4zzz4k
04/16/2019, 4:56 PMDominaezzz
04/16/2019, 5:28 PM