I got an issue reported on <my library> that the `...
# multiplatform
e
I got an issue reported on my library that the
Uri
type is exported to Swift as
any UriUri
, and functions from
Uri
aren't visible on it. I'm not so familiar with Swift export; anyone know why something like that would happen?
a
Hello there. You can reproduce and fix the issue with the following steps: 1. go to https://kmp.jetbrains.com 2. select only ios(as the report is about iOS), and "do not share ui" 3. download 4. add your library as a dependency 5. add the following stub into iosMain
fun createUri(): Uri = TODO()
6. Open xcode and compile and go to the resulted Objective-C header 7. Discover that issue exists 8. Consult the documentation: https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-build-native-binaries.html#export-dependencies-to-binaries 9. add
export("com.eygraber:uri-kmp:0.0.19")
to the
framework
block on the demo project and recompile 10. check resulted translation to discover that protocol got exported in a way that user wanted in to. Long story short - your user complaints about mangling of transitively exported declaration. Your user is able to avoid that by declaring your dependency explicitly exported(step 9).
thank you color 2