AppleSettings : Unresolved reference
See original GitHub issueHello
I am trying to use AppleSettings constructor, but it seems to me as Unresolved reference.
val commonMain by getting {
dependencies {
implementation("com.russhwolf:multiplatform-settings:0.7.1")
}
}
I have added its dependencies like the code above and into module shared:iosMain I try to use the following:
val delegate: NSUserDefaults // ...
val settings: Settings = AppleSettings(delegate)
However the AppleSettings constructor is not available.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
android - Unresolved reference: Platform, in multiplatform project
I have created a kotlin shared library project (using Android Studio on Windows), the android side of things work fine, but for some...
Read more >Creating a simple Kotlin Multiplatform project based on moko ...
settings: AppleSettings(delegate: UserDefaults.standard), antilog: DebugAntilog(defaultTag: "MPP"), baseUrl: "https://api.giphy.com/v1/",
Read more >Unresolved reference "platform" when using the "ios" target ...
Create a new class under iosMain and attempt to reference a class in the CocoaTouch framework (such as NSString ).
Read more >Bring Your Own iPhone | Switch to Cricket
1. Go to Settings and select General. Apple Settings · 2. Tap Software Update to see if your software is up to date....
Read more >Reference - Resource Watch API - GitHub Pages
This section of the documentation contains technical reference information ... 404, Relationship between undefined and dataset - <dataset id> and dataset: ...
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
There’s different issues being conflated here and I want to differentiate what people are asking for better.
One issue is, the library builds but there’s red code in the IDE. This is probably from using a shared iOS source-set (often, from the
ios()
target builder) when the library doesn’t declare the HMPP gradle properties. I’ve been wary of adding that because I don’t want to break consumers who aren’t using those flags yet, and also I’ve had build issues in the past when enabling it. It’s probably worth re-examining at some point, but it’s been a lower priority for me because it doesn’t block your build and it likely only impacts one file where you’re initializing your iOS Settings instance.Another issue is, the project doesn’t build at all. That’s what @afaucogney seems to be reporting… That’s a bigger issue that I’d like to understand better, but I’ve never seen it in action in any of my own projects, so I could use some help here with a full project that reproduces it.
@krottv your sample appears to be only a single module from a larger project and doesn’t build on its own, so it doesn’t help me. But I’m also not clear on which of those two buckets you fall into
@cmota brings up a further confounding factor in the new M1 macs. I haven’t used one myself yet so I don’t have a good sense of how it impacts this whole story. If
multiplatform-swiftpackage
gives you what you need, then that sounds great. I suspect doing an ad-hoc target declaration similar to the sample project would also work, but I’m not sure that’s a solution that scales great for large multimodule projects. In any event, I don’t think there’s anything that makes sense to add at the library level to help here. Packaging is a concern that should really be handled at the application level.You should now be able to resolve AppleSettings in the IDE in shared iOS sourcesets in version 0.8