https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Andrew O Hart

11/19/2021, 2:21 PM
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

russhwolf

11/19/2021, 2:57 PM
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

Andrew O Hart

11/19/2021, 3:00 PM
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
8 Views