I am developing KMM library called edoLibrary used...
# multiplatform
j
I am developing KMM library called edoLibrary used both on ios and android platforms. edoLibrary uses inside native modules responsible for video capture. On Ios platform video module called iosBiometry is added by c-interoperability. When I am publishing final edoLibrary binary and adding it to my ios project it also demands from me to add as a framework iosBiometry module with message: dyld: Library not loaded: @rpath/iosBiometry.framework/iosBiometry  Referenced from: /private/var/containers/Bundle/Application/5964BC21-66DB-4634-915A-450D647EC5E0/Multiplatform_Poc.app/Frameworks/edoLibrary.framework/edoLibrary  Reason: image not found Is there any way to export KMM shared module as umbrella framework containing all depended frameworks added by c-interoperability? I know that there is an export method but i don't know how to connect cinterop as a dependency. Or should I use cocoapods? below photo of iosBiometry c-interoperability and edoLibrary final native configuration.
v
Hi Jakub, Try to add
isStatic=true
to your edoLibrary framework config. In that case it will be linked statically with iosBiometry
a
also, it is a already a library. Just call it edo, instead of calling it edoLibrary
j
@Viacheslav Kormushkin After setting property isStatic = true in edoLibrary configuration and publishing package, I am getting this error on build in test app: Undefined symbols for architecture arm64:  "_OBJC_CLASS_$_FaceTec", referenced from:    objc-class-ref in edoLibrary(result.o) ld: symbol(s) not found for architecture arm64 @andylamax Thanks for suggestion, but to be honest it is not me who is choosing the name of the project :D
v
How do you package and publish edoLibrary?
j
Today I will try to migrate to newer version of kmm plugin and use "embedAndSignAppleFrameworkForXcode", but for now, here is my task responsible for that:
Migrating to newer version and using task embedAndSignAppleFrameworkForXcode did not change anything, still getting the same error in swift test app for both frameworks linked by cinterop in edoLibrary: "Undefined symbols for architecture arm64 ..." I changed iphone ios system version to 15.3 Android studio kmm plugin version: 0.3.0(211-1.6.0-release-795-IJ)-194 com.android.tools.build 7.1.0 kotlin gradle plugin 1.6.10
v
Hmm, probably making iosBiometry static will fix the problem, pls try adding
-Xstatic-framework
compiler option to cinterop
j
Should I add this option just to compiler options? Or to linker options too? Where in documentation can I find information about static linking cinteropped libraries?? Should it look like that? If yes, I am still getting the same error.
v
Hey Jakub, sorry for pointing you to a wrong direction. I’ve discussed this case with a guy from a kotlin/native team and looks like you still need to include iosBiometry framework into Xcode project so Xcode could link against it. Cinterop tool just creates bindings that are used buy IDE as proxy view to native binary so actual native binary is needed when the final app is being linked. As you mentioned you could use cocoapods for your task. For that create a podspec for iosBiometry library, push to a private spec repo and add to edoLibrary as a cocoapod dependency. In that case cocoapods will add all required dependencies to your app for you.