Hi :wave: I’m looking to use BitSet (kotlin.native...
# multiplatform
r
Hi 👋 I’m looking to use BitSet (kotlin.native.BitSet) in my common code. However, Android Studio doesn’t seem to find that package. I was under the impression that it’s included in the stdlib. Do I need to include that dependency explicitly?
m
Are you using it from a native source set and not something like
commonMain
. If you are using it from a shared native source set like
iosMain
you need to enable commonizer for Android Studio to show it.
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableCInteropCommonization=true
r
i am trying to use it in
commonMain
, is that not the way to go?
m
That class is only available in native so you cannot access it from common. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native/-bit-set/ You would need to do some sort of expect/actual declarations to point to the JVM and the native ones on the correct platforms and then common code can use those. Would have been nice if they provided that for you, but there probably is not a JS version.
🙌 1