https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
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 :
Copy code
language = Objective-C
modules = MetalEngine
package = MetalEngine
And this is the gradle build script from shared module :
Copy code
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?
11 Views