Hi, i am using lifecycle 2.8.0 from jetbrains and ...
# multiplatform
a
Hi, i am using lifecycle 2.8.0 from jetbrains and I ran into this error while trying to share viewmodels with KMPObservableViewModel
image.png
I am running these versions here
my androidx viewmodel looks like this
imports are correct as per documentation of kmpobserbableviewmodel
From what i can see, when annotating with nativecoroutine state
simething goes wrong
@Rick Clephas any idea what is happening here?
image.png
image.png,image.png
r
What should
viewModel.uitState.wrappedValue
return? Shouldn’t it just be
viewModel.uiState
?
a
yes sorry it should be .uiState
the result still remains the same
same error thrown
Once I have annotated my stateflow with NativeCoroutineState I cant even reference it 🤔
r
Could you check that both the KMP-NativeCoroutines and KSP plugin are applied to your shared Kotlin module?
a
yes i have them both
I will check the umbrella shared module though that might be it
r
Note that those plugin should be applied to the module where the viewmodel is defined. And in case you viewmodel is inside another module (not being the shared module) you would need to export that module.
1
a
yes I am exporting but it might be KSP not properly generating things
i will try thanks for the tip
r
Yeah if adding the annotation only hides the property then something is going wrong with the generation / visibility of the extension
a
Ok, so after trying i ran into another problem, as soon as i apply the native coroutines plugin
Cannot change attributes of configuration 'featurerandom-joke:debugFrameworkIosX64' after it has been locked for mutation
it seems to be related to ksp in k2
Copy code
compose-plugin = "1.7.0-alpha01"
@Rick Clephas I am not sure if this is even related to your lib at all but this version of compose multiplatform breaks the build with native coroutines
downgraded to 1.6.11 and all is good and well
👍🏻 1