Anyone playing with kotlin-multiplatform and this library: com.russhwolf:multiplatform-settings ?
In my project which I have just created:
IntelliJ 2020.3 > File > New > Project… > Kotlin > Mobile Application
I have added a dependency:
Copy code
val commonMain by getting {
dependencies {
implementation("com.russhwolf:multiplatform-settings:0.6.1")
}
}
Inside iosMain I have added this code:
Copy code
fun test(d: NSUserDefaults) {
AppleSettings(d)
}
And everything compiles correctly but IDE complains about AppleSettings that (Cannot access class ‘platform.Foundation.NSUserDefaults’. Check your module classpath for missing or conflicting dependencies) [see image below]
any ideas what could be the reason of this error?
r
russhwolf
01/26/2021, 2:52 PM
It happens because Multiplatform Settings uses a bunch of intermediate source-sets internally and IDE support is still incomplete there. Things will work better if you use specific targets like