[0.6-1.4.0-rc] AppleSettings is not accessible in iosMain code
See original GitHub issueHi,
I am using 0.6-1.4.0-rc with latest 1.4.0-rc Kotlin’s version and while I am able to access the common Settings code (like Settings interface) from my iosMain shared code module, I can’t seem to be able to access iOS related code like AppleSettings to use this factory. I get UnresolvedReference error.
I am just trying to do the following in iosMain/Whatever.kt
AppleSettings.Factory().create("name.prefs")
Was there any change for this version that I am missing?
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Enable iosMain sourceSet in Kotlin Multiplatform Mobile projects
Pros: the code is not duplicated, located in one sourceSet; all platform API available; separate gradle tasks for compiling both architectures ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No deliberate changes that would lead to an error like that. You shouldn’t need those iOS-specific exports if you don’t need to access
AppleSettings
from Swift. Nothing in that build.gradle jumps out at me as an obvious cause for an issue like this, though there are some unrelated issues (mockk won’t work on native, serialization 0.20.0-1.4.0-rc doesn’t exist and should be 1.0-M1-1.4.0-rc)Just in case, is it a build error or just an IDE error? ie can you build directly from gradle?
Same thing happening for me - have added the dependency under
commonMain
and imported usingimport com.russhwolf.settings.AppleSettings
resulting in the IDE showing the class not found. However, building and running the app works fine on both iOS and Android so not a huge issue but I wasted a bit of time trying to understand what I did wrong until I came across this issue.