serebit
08/02/2020, 3:19 AMJohn O'Reilly
08/02/2020, 8:35 PM1.3.8-native-mt-1.4.0-rc
of kotlinx coroutines....but right now need to use the non native-mt
version for macOs target....in pre-1.4 (before "hierarchical project structure" support I could add appropriate strict version setting in gradle....is there any recommended way to do that now (tried a few options but doesn't seem to work for some reason)?edenman
08/04/2020, 2:49 AMactual
declaration as an error `The feature "multi platform projects" is experimental and should be enabled explicitly`…anybody else seeing this? AGP 4.2.0-alpha07, kotlin 1.4.0-rc, kotlin AS plugin 1.4.0-rc-release-Studio4.1-2Mgj
08/04/2020, 2:07 PMA problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'dev.icerock.mobile.multiplatform-resources']
> Could not create plugin of type 'MultiplatformResourcesPlugin'.
> Could not generate a decorated class for type MultiplatformResourcesPlugin.
> org/jetbrains/kotlin/gradle/plugin/KotlinSourceSet
when i try to apply the plugin:
apply plugin: 'dev.icerock.mobile.multiplatform-resources'
I've tried moving it around in my gradle file, but no luckAlberto
08/04/2020, 3:36 PMserebit
08/04/2020, 4:47 PM.konan
directory, it seems to try compiling some of the targets before their dependencies are done downloading.zsperske
08/04/2020, 6:36 PMBrandon Saunders
08/05/2020, 10:13 AMconfig.optimization.splitChunks = {
minSize: <someNumber>,
maxSize: <theSameNumber>
};
I get nothing in my distributions folder. If I remove it, the distributions folder gets created on build. Any ideas?andylamax
08/05/2020, 3:34 PMkotlin("js")
. But the code compiles just fine. However when using kotlin("multiplatform")
the dependencies are resolved well for all targets including js
. I don't want to add the kotlin("multiplatform")
plugin as this is a JS only library, any current work arroud?Slackbot
08/05/2020, 4:52 PMandylamax
08/05/2020, 9:19 PMtheme-core
which at the moment, targets js
jvm
and android
.
I also have a pure js library theme-react
which depends on theme core
.
theme-react
being a purely js
lib. It has it's sources located at src/main/kotlin
while theme-core
sources for targeting js are at src/jsMain/kotlin
I am trying to use theme-react
and ultimately theme-core
as a dependency to a pure js react ui library called enteprise-react
. as always sources are located at src/main/kotlin
Idea is able to resolve theme-react
sources but can't resolve theme-core
sources. After being bugged by this for a while, I tried changing my build.gradle.kts
like so
sourceSets {
val jsMain by creating {
dependencies {
api(project(":theme-core"))
api(project(":theme-react"))
}
}
val main by getting {
dependsOn(jsMain)
dependencies {
api(kotlin("stdlib-js"))
api("org.jetbrains.kotlinx:kotlinx-react:${versions.kotlinjs.react}")
api("org.jetbrains:kotlin-styled:${versions.kotlinjs.styled}")
api("org.jetbrains:kotlin-css-js:${versions.kotlinjs.css}")
}
}
}
so now enterprise-react
has two sourceSets. jsMain
and main
.
If I put my sources in jsMain
all pure js libraries (including kotlin-react
and kotlin-styled
) aren't resolved by IDEA. If I put my sources in main
IDEA failes to resolve all dependencies build from the sources of the subprojects at jsMain
(i.e. theme-core
) and all other mpp supprojects.
I tried seperating my sources, no luck. as there is a moment I need resources from both theme-core
and kotlin-react
.
Has anyone experienced this issue at all? any workaround suggestions please . . . Thank you in advanceedenman
08/05/2020, 9:41 PMexpect
in the commonMain sourceset and an actual
in my androidMain
sourceset, is there any way to provide a different actual
in androidTest
?zsperske
08/05/2020, 10:15 PMpatjackson52
08/07/2020, 4:08 PMThe consumer was configured to find a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of:
it then proceeds to list all of the variants. When looking at the module file there is only one artifact with type ‘org.jetbrains.kotlin.platform.type’ (the metadata module). Anyone else seeing this?ivan.savytskyi
08/07/2020, 9:12 PMUnresolved reference
for any class defined in commonMain
folder. Project perfectly compiles via command line so this issue seems IDEA specific. Invalidating cache doesn't help.Prateek Grover
08/09/2020, 1:48 AMNikky
08/09/2020, 5:44 PMDaniele B
08/10/2020, 7:37 PMDaniele B
08/10/2020, 7:39 PMyousefa2
08/11/2020, 1:51 PMAlberto
08/11/2020, 8:23 PMzsperske
08/12/2020, 4:36 PMsaket
08/12/2020, 5:32 PMJohn O'Reilly
08/12/2020, 6:08 PMsuspend
functions (that use Ktor) directly from iOS client but running in to a few issues (thread)...aleksey.tomin
08/13/2020, 6:14 AM./gradlew tasks
see error
Please initialize at least one Kotlin target in 'my-project (:)'.
What I need to do? On 1.3.72 all OK.
--info and --debug doesn’t help me.
macOS, KMP contains OSX/minGW/android code
gradle 6.4, 6.5.1 or 6.6, jdk - 1.8 or 11 - result the same
PS: Solved - just add into root build.gradle.kts
kotlin {
jvm()
}
Thanks for @msinkSamuel Bichsel
08/13/2020, 8:37 AMtargets {
targetFromPreset(presets.android, "android")
final def iOSTarget = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm" \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'ios')
}
cocoapods {
summary = "Shared Kotlin/Native module"
homepage = "<https://github.com/dreipol>"
frameworkName = "Shared"
}
I read in the documentation, that yore able to export it like that , but that doesn’t work with the cocoapods integration:
fromPreset(iOSTarget, 'ios').binaries {
framework {
export "ch.dreipol:dreimultiplatform:$dreiMultiplatformVersion"
}
}
Does anyone have a hint?nrobi
08/14/2020, 9:06 AMWill Hess
08/14/2020, 7:46 PMimport org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
task into my build.gradle
file?
I am trying to create a fat framework that can be consumed in my iOS sample application.Peter Hsu
08/15/2020, 7:33 AMCoroutineScope(Dispatchers.Default).launch {
...
}
iOS output when calling from the main thread:
kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
I'm running on iOS simulator, would that be the issue?
I suspected a dependency versioning issue, so I am forcing coroutines version to be 1.3.5-native-mt via gradle as it seemed to be being force back to 1.3.5 without it, using the following in my root gradle:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == "org.jetbrains.kotlinx" &&
details.requested.name == "kotlinx-coroutines-core-common") {
details.useVersion("$coroutinesVer")
}
if (details.requested.group == "org.jetbrains.kotlinx" &&
details.requested.name == "kotlinx-coroutines-core") {
details.useVersion("$coroutinesVer")
}
}
}
}
and my dependencies tasks indicate the proper libs are being pulled in now.
I'm really confused why I'm getting this error message. It was my understand that 1.3.5-native-mt utilizes a single background thread for Dispatchers.Default.Davide Giuseppe Farella
08/15/2020, 10:04 PMactor
, for implement a debounce operator. On jvm I would write ( I’ll skip something for simplicity ) :
val result = MutableStateFlow(emptyList<Movie>)
val searchActor = scope.actor<String>(CONFLATED) {
for (query in channel) {
delay(250) // debounce
result.value = searchMovie(query)
}
}
// Outer world
launch { result.collect { ... } }
searchActor.send(query)
What would be a nice solution on KMP? Thank youDavide Giuseppe Farella
08/15/2020, 10:04 PMactor
, for implement a debounce operator. On jvm I would write ( I’ll skip something for simplicity ) :
val result = MutableStateFlow(emptyList<Movie>)
val searchActor = scope.actor<String>(CONFLATED) {
for (query in channel) {
delay(250) // debounce
result.value = searchMovie(query)
}
}
// Outer world
launch { result.collect { ... } }
searchActor.send(query)
What would be a nice solution on KMP? Thank youArkadii Ivanov
08/15/2020, 11:00 PMDavide Giuseppe Farella
08/15/2020, 11:30 PM