question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[0.6-1.4.0-rc] AppleSettings is not accessible in iosMain code

See original GitHub issue

Hi,

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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
russhwolfcommented, Jul 31, 2020

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?

0reactions
gchristovcommented, Apr 7, 2021

Same thing happening for me - have added the dependency under commonMain and imported using import 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found