Hey everyone, I am trying to bundle libvlc as a ko...
# multiplatform
s
Hey everyone, I am trying to bundle libvlc as a kotlin multiplatform library but when I use it in swift I get "Framework VLCKit not found" error.
Copy code
plugins {
    alias(libs.plugins.android.kotlin.multiplatform.library)
    alias(libs.plugins.kotlinMultiplatform)
    alias(libs.plugins.kotlinCocoapods)
}

kotlin {
    jvmToolchain(17)

    androidLibrary {
        namespace = "dev.sajidali.onplayer.vlc"
        compileSdk = 35
        minSdk = 21
    }

    jvm("desktop")

    val xcfName = "VlcKit"
    listOf(
        iosSimulatorArm64(),
        iosArm64(),
        iosX64(),
        tvosX64(),
        tvosArm64(),
        tvosSimulatorArm64(),
//        macosArm64(),
//        macosX64()
    ).forEach {
        it.binaries.framework {
            baseName = xcfName
//            linkerOpts.add("-framework")
//            linkerOpts.add("VLCKit")
            isStatic = false
        }
    }

    cocoapods {
        summary = "Shared LibVLC Implementaion"
        homepage = ""
        version = "1.0"
        ios.deploymentTarget = "18.0"
        tvos.deploymentTarget = "18.0"
//        osx.deploymentTarget = "15.0"

        framework {
            isStatic = false
            baseName = xcfName
        }

        pod("VLCKit") {
            version = "4.0.0a16"
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
    }

    sourceSets {
        commonMain {
            dependencies {
                api(project(":oneplayer"))  // Consider making this api if you want to export it too
                implementation(libs.kermit)
            }
        }

        androidMain {
            dependencies {
                implementation(libs.core.ktx)
                implementation(libs.appcompat)
                implementation(libs.constraintlayout)
                // Add LibVLC dependency
//                implementation(libs.libvlc.all)
            }
        }

        appleMain {
            dependencies {
                // Any iOS-specific dependencies
            }
        }
    }
}
This is my gradle config. What am I doing wrong?
f
Hi, have you tried spmforkmp ? I know VLCKit is not SPM compatible; but you can use the binary one.