Aight one more, for the iOS source set in my commo...
# multiplatform
a
Aight one more, for the iOS source set in my common module, how do I get access to the platform apis? I see how I would include third party libraries via CocoaPods or a definition file, but not the built-in platform APIs
p
Well they should be in your class path
Try an import Foundation.*
a
ya that's what it seemed like from the docs, but
import Foundation.*
Foundation isn't recognized
this is in my
iosMain
source set
also the
platform.posix
package isn't found which the docs seems to indication should be there
Copy code
ios {
        binaries {
            framework {
                baseName = "common"
                export("com.arkivanov.decompose:decompose:0.6.0")
                export("com.arkivanov.essenty:lifecycle:0.3.1")
            }
        }
    }
ya I feel like something has got to be wrong, this sure indicates that at least the platform package should be available: https://kotlinlang.org/docs/native-platform-libs.html
a
What Kotlin version are you using? Do you have HMPP enabled?
a
1.6.10
so no on HMPP, unless i upgrade to 1.6.20
a
In this case you have to enable it manually - https://kotlinlang.org/docs/multiplatform-hierarchy.html
a
what will HMPP do for me in relation to this issue?
a
It will enable the commonizer, so you can use platform things in intermediate source sets - https://kotlinlang.org/docs/multiplatform-share-on-platforms.html
a
aha!
let me just try updating to
1.6.20
that should enable it by default I think
a
You can also do it without HMPP, the code will compile but the IDE will show errors. You can rename iosMain to e.g. iosX64Main, edit the code and rename back to iosMain.
a
yup, that did it, looks like it lives under the package
platform.Foundation.*
a
1.6.20 would be good, but you will have to use the latest unstable versions of Compose
a
thanks again, for the millionth time
🎉 1
ah i see
is decompose on that version yet?
maybe ill stick w\ stable and enable it manually
a
Decompose depends on Compose 1.1.1, but they should be binary compatible I guess.
1.6.10 should work fine, unless you are affected by a bug fixed in 1.6.20 😀
a
unrelated, but I wonder, now that there's some jetbrains compose native targets, if we'll get native desktop compose eventually.
a
There are dev builds for native iOS and macOS already
a
thats pretty cool. Not shipping with a bundled jvm on desktop would be a nice feather in the cap.
a
Btw, there is a channel for Decompose-specific questions - #decompose
a
Oh great, now that it looks like I'm over the hump of most of the multi-platform specific issues that will be helpful