Hey guys! I’m trying to implement a library in KM...
# multiplatform
h
Hey guys! I’m trying to implement a library in KMM, which would run tensorflow-lite inference on Android and iOS. For Android, I use the standard tflite dependency from Maven, and for iOS I’m using the C library provided by Google. As usual, I have
expect
declarations with
actual
implementations for each platform that wrap those differences and provide a single interface. This part works fine. Let’s call this module
tfliteWrapper
. Now I’m trying to use it as a dependency in another module, let’s call it
dependentModule
and it fails at this step:
Copy code
Task :dependentModule:linkDebugTestIos
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors

The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: framework not found TensorFlowLiteC
This is how I specify the dependency:
api(project(":tfliteWrapper"))
and I also have this setting:
Copy code
binaries {
    framework {
        xcFramework.add(this)
            isStatic = true
        }
    }
I expected it to produce a static library that would include tflite, but this is not the case, I assume. How could I fix this problem? If there’s a piece of my setup or some information in the produced frameworks/klibs that I should have included here, please let me know and I’ll provide it.