Thomas Kranzer
01/05/2022, 7:23 AMPaul Weber
01/05/2022, 9:58 PMfunc foo(_ arg: Bar) {}
.
I.e., you can just foo(myArg)
instead of having to foo(arg: myArg)
It’s probably not possible to declare a function in kotlin that behaves the same way at the swift callsite, right?Anamika Trivedi
01/06/2022, 2:00 AMAn Tran
01/06/2022, 3:21 AMxxfast
01/06/2022, 4:36 AMFlow<State>
from a shared ViewModel
, in a Typescript react app (not using kotlin react wrappers). This is how that looks like
// View.tsx
export function View() {
const viewModel = new JsViewModel()
const [state, setState] = useState(viewModel.initialState)
useEffect(() => {
viewModel.subscribe((state) => { setState(state) })
})
return (
<p>{state.value}</p>
)
}
// ViewModel.kt
@JsExport
class JsViewModel {
...
private val viewModel: ViewModel by viewModel()
fun subscribe(
onChange: (state: State) -> Unit,
) {
viewModel.launch {
viewModel.states.collect { state -> onChange(state) }
}
}
}
This pretty much works, but there’s a collect
launched, which is technically not managed. Is there a better way to hookup the kotlin flow with the react hook?Lena Stepanova
01/06/2022, 2:55 PMShan
01/06/2022, 7:20 PMpublishing {
publications.withType<MavenPublication> {
artifactId = "custom-name"
configureMavenPom(project)
signing { if (isRelease) sign(this@withType) }
}
}
This will create a publication with the right name for the artifact but appears to be causing a bug when actually trying to use it. Someone is having the same issue here: https://stackoverflow.com/questions/70489135/unable-to-use-published-kmp-library-due-[…]o-error-detecting-cycle-in-external-va/70490150?noredirect=1
So my IDE can detect the dependency that I published (above), but Gradle cannot seem to resolve it. The actual error message:
Detecting cycle in external variants for :
my.dependency:dependency:version: //<---- the one i published (above)
- my.other.project:other:version
Dependency resolution has ignored the cycle to produce a result. It is recommended to resolve the cycle by upgrading one or more dependencies.
rkechols
01/06/2022, 7:54 PM/androidApp
portion and the /shared/src/androidMain
?
• Is it possible for an expect
declaration in the shared code (/shared/src/commonMain
) to find its actual
implementation in the /androidApp
portion?v79
01/07/2022, 2:26 PMimport com.github.quillraven.fleks.World
is highlighted red too. So.... what do I do?Rodrigo Bressan De Souza
01/07/2022, 2:34 PMbrabo-hi
01/07/2022, 11:20 PMkotlin Number
type to represent monetary value?Sourabh Rawat
01/08/2022, 6:11 AMCould not determine the dependencies of task ':desktop:run'.
> Could not resolve all task dependencies for configuration ':desktop:jvmRuntimeClasspath'.
> Could not resolve project :common.
Required by:
project :desktop
> The consumer was configured to find a runtime of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'. However we cannot choose between the following variants of project :common:
- commonJvmDefault
- commonJvmRuntimeElements
- desktopDefault
- desktopRuntimeElements
gradle files posted in thread.dimsuz
01/08/2022, 11:06 PM<dependencies>
section.
Does anyone know why this can happen and how to fix this? Adding the dependency directly to a consuming project works, but I'd like to avoid requiring users of my library do that manually.Radoslaw Juszczyk
01/10/2022, 12:19 PMe: Compilation failed: null
* Source files:
* Compiler version info: Konan: 1.6.10 / Kotlin: 1.6.10
* Output kind: FRAMEWORK
e: java.lang.NullPointerException
at org.jetbrains.kotlin.backend.konan.optimizations.DataFlowIR$SymbolTable.mapClassReferenceType(DataFlowIR.kt:520) ...
I got it when trying to execute linkMultiplatformAppReleaseFrameworkIosArm64 gradle taskspierce7
01/10/2022, 8:48 PMDouaa Su
01/11/2022, 10:21 AMKathrin Petrova
01/11/2022, 11:32 AMAnton Afanasev
01/11/2022, 4:01 PMJozef Matus
01/11/2022, 4:14 PMnative-mt
coroutines and works on apple silicon ios simulator. Did anybody make it work please ?ultraon
01/11/2022, 4:51 PMgradle 7.3.3
is supported by KMM plugin? I've found that unit tests for native platform can't be run.rahulrav
01/12/2022, 1:15 AMos_signpost_emit_with_type
, and I can't seem to find it.
https://developer.apple.com/documentation/os/os_signpost_emit_with_type?language=objccalrissian
01/12/2022, 5:12 AM<script src="myJS.js"></script>
but when my frontend tries to request that JS file from my Ktor server it response with 404 .. (the request made is http//hostport/myJs.js)I followed the steps to copy myJr.js into my jar file but still seems like the file can't be found..
Also to be clear when I run jsBrowser[Development/Production]Run everything works correctly. But that is likely because webpack dev server is serving js file
Also I would like to mention that when I manually create an endpoint get("/myJs.js") and return static resource myJs.js all seems to work as expected
not sure what I am missing .. any help or suggestions would be appreciatedTravis Reitter
01/12/2022, 6:21 AM.m
and .h
files that way so I can use them in some actual
implementations? Or do I have to somehow build a library of the .m
files and link against that? I'm trying to follow the Gradle examples here but my iOS build is failing to find my header. Not sure if I have to adjust my Xcode project to include the header file or what.
Any help is greatly appreciated!Robert Munro
01/12/2022, 12:13 PM@ExperimentalTime
in my multi-platform module - but the following doesnt work :
sourceSets {
all {
languageSettings.optIn("kotlin.time.ExperimentalTime")
}
}
languageSettings
cant be found
languageSettings.optIn("kotlin.time.ExperimentalTime")
^ Unresolved reference: languageSettings
anyine know what am i missing? this seems to be exactly as per the documentation page https://kotlinlang.org/docs/opt-in-requirements.html#module-wide-opt-in
i'm updating to 1.6.10
SrSouza
01/13/2022, 12:38 AMexpect interface
with a expect val property: String
that should be defined with actual get() =
?
The currently interface I want to move to multiplatform looks something like this:
interface Screen : Serializable {
val key: String
get() = this::class.qualiedName ?: error()
}
So it was Serializable
, I'm expect/actual for the JVM version to have Serializable (Android need it), and the key I'm not able to use expect/actual.Stefan Oltmann
01/13/2022, 10:52 AM@JvmInline
value class PhotoUri(val value: String)
In Swift PhotoUri
is not defined according to the error message.
Attributes that use it seem to be of type Any
now.
If I change that to an data class it's available.
How can I use value classes with Kotlin v1.6.10?Thomas Kranzer
01/13/2022, 11:55 AMincludeBuild
)? If yes, are there any working examples?hfhbd
01/13/2022, 1:24 PMval xcf = XCFramework()
fun KotlinNativeTarget.config() {
binaries {
framework {
baseName = "shared"
export("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
xcf.add(this)
}
}
}
iosArm64 { config() }
iosSimulatorArm64 { config() }
macosArm64 { config() }
macosX64 { config() }
iOS targets work without any problem, macOS fails with `Fat frameworks are not supported for platform `macos_arm64``georgi
01/13/2022, 9:16 PM./gradlew connectedAndroidTest
where my shared module unit tests inside src/commonTest/kotlin
also run as part of the Android instrumented tests. Anyone experienced this before? 🤔 More details in 🧵Radoslaw Juszczyk
01/14/2022, 6:47 AMinterface SomeViewModelDelegate {
fun consumeState(state: State)
}
sealed class State {
object Loading: State()
data class Loaded(
val data: String,
): State()
data class Error(val errorMessage: String): State()
}
In this case only State is exposed to swift but not Loading, Loaded, Error so I cannot type check nor cast it to these specific types.
Any ideas how to get it exposed to swift?