https://kotlinlang.org logo
Title
l

lonto

11/04/2021, 12:44 PM
Hello all! I am currently trying to add a custom XCFramework to the shared KMM module without using cocoapods. This is my
MetalEngine.def
file :
language = Objective-C
modules = MetalEngine
package = MetalEngine
And this is the gradle build script from shared module :
iosTarget("ios") {
        binaries {
            framework {
                baseName = "shared"
            }
        }

        compilations.getByName("main") {
            val MetalEngine by cinterops.creating {
                defFile("src/nativeInterop/cinterop/MetalEngine.def")
                compilerOpts("-framework", "MetalEngine", "-F/shared/src/MetalEngine.xcframework")
            }
        }

        binaries.all {
            linkerOpts("-framework", "MetalEngine", "-F/shared/src/MetalEngine.xcframework")
        }
    }
Im getting
fatal error: module 'MetalEngine' not found
error. Am I missing any config step?
k

kpgalligan

11/04/2021, 3:39 PM
I would guess that your path is absolute, not relative
"-F/shared/src/MetalEngine.xcframework"
b

Bailey Pollard

02/11/2022, 4:58 PM
Did you get this to work?
j

João Pinto

03/08/2022, 7:23 PM
anyone could help here? I too have the same problem