Also, we have several cinterop .def files etc, we ...
# multiplatform
a
Also, we have several cinterop .def files etc, we can use them in iosMain,however all references to the classes are Red, like they are not resolved. Any ideas on how this can be fixed? If its even possible I'm not sure. It compiles fine just auto complete/import and viewing of methods etc doesnt work
r
Try adding these lines to
gradle.properties
Copy code
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableCInteropCommonization=true
See also https://kotlinlang.org/docs/mpp-share-on-platforms.html#use-native-libraries-in-the-hierarchical-structure
a
Hey, Yeah I have all those added to my gradle.properties 😞 That fixed issues with Apple classes. However, the issue I'm facing is with cinterop libs we add in build.gradle For example this:
Copy code
// import SQLCipher library
create("SQLCipher") {
    packageName("com.retailinmotion.SQLCipher")
    defFile = file("$projectDir/src/iosMain/c_interop/SQLCipher.def")
    includeDirs("$projectDir/src/iosMain/c_interop/SQLCipher/")
    extraOpts("-libraryPath", "$projectDir/src/iosMain/c_interop/SQLCipher/")
}
I can use
Copy code
import com.squareup.sqldelight.drivers.native.NativeSqliteDriver
and it will compile, however NativeSqliteDriver shows as red in the class and I can't view methods on it