icerockdev / moko-kswift

Swift-friendly api generator for Kotlin/Native frameworks
https://moko.icerock.dev
Apache License 2.0
350 stars 21 forks source link

Files for external libraries generate with errors #73

Closed sed0 closed 1 year ago

sed0 commented 1 year ago

Hello! We need kswift to generate files for external libraries but it's generating files with these errors: "Cannot find type 'ClassName' in scope" and "No type named 'ClassName' in module 'shared'"

The generated files are ok but it looks like the libraries are inaccessible in ios/swift for some reason. We use kswift with default settings in a number of projects and all of the external lib files are generated with this issue

Alex009 commented 1 year ago

hi! external libraries should be exported in framework settings to use from swift. https://kotlinlang.org/docs/multiplatform-build-native-binaries.html#export-dependencies-to-binaries

also you can add excludeLibrary in gradle to not generate code that you will not use