Hi All! I've got a KMM question you might have ex...
# multiplatform
s
Hi All! I've got a KMM question you might have experienced before... Basically we are building a KMM Lib that depends on a Pod (it's tensorflow) but when we import the exported SwiftPackage to the Demo app it doesn't seem to be including the pod in the dependencies. Do you know if there is a way of exporting the pod with the XCFramework file? I'm kinda stumped and can't see anything on the channels. This is what I have in the Gradle build file
Copy code
iosArm64 {
    binaries {
        framework {
            isStatic = true
            transitiveExport = true
        }
    }
}

cocoapods {
    summary = Metadata.IOS.summary
    homepage = Metadata.IOS.homepage
    version = Metadata.IOS.sdkVersion
    ios.deploymentTarget = Metadata.IOS.deploymentTarget
    framework {
        baseName = Metadata.IOS.frameworkBaseName
        isStatic = true
        transitiveExport = true
    }
    pod("TensorFlowLiteTaskVision")
}
Basically when we use it we get this error in XCode
Undefined symbol: _OBJC_CLASS_$_GMLImage
which is part of the Tensorflow pod...
a
Hi! Pod-dependencies are not embedded in the framework produced by Kotlin. You need to specify somehow in the iOS app build config that you want to link against Tensorflow. It would be done automatically if you would use generated podspec for connection to xcode/cocoapods project.
s
Hi @a-dd Thank you so much for getting back to me on this. Your answer has allowed us to change the process we are using. It involves us moving away from tensorflow lite on iOS and migrating to CoreML. This now works perfectly. 😃