Skip to content

bundleSearcher cinterop klib "can't be exported with -Xexport-library" warning when exporting resources from an iOS framework #900

Open

Description

@treitter

Linking an iOS framework that exports moko-resources prints a warning for its bundleSearcher cinterop klib:

warning: Interop library ~/.gradle/caches/modules-2/files-2.1/dev.icerock.moko/resources-iossimulatorarm64/0.27.1/.../resources-iosSimulatorArm64Cinterop-bundleSearcherMain-0.27.1.klib can't be exported with -Xexport-library

It appears on every framework link (linkDebugFrameworkIosSimulatorArm64, linkReleaseFrameworkIosArm64, ...). The build and the app work; the warning is just noise.

Setup

kotlin {
    sourceSets.commonMain.dependencies {
        api(libs.resources) // dev.icerock.moko:resources:0.27.1
    }
    listOf(iosArm64(), iosSimulatorArm64()).forEach {
        it.binaries.framework {
            isStatic = true
            export(libs.resources)
        }
    }
}

The export is needed so Swift can use moko's resource types (StringResource, ImageResource, desc(), etc.). Exporting the library also exports its cinterop klib, which Kotlin/Native can't re-export.

#414 reported the same warning for an earlier cinterop library (pluralizedString), which went away when 0.21.0 removed that cinterop. bundleSearcher seems to have brought it back.

Could the bundleSearcher interop be kept out of what export() picks up (or folded into the main klib), so exporting moko-resources doesn't warn?

Versions: moko-resources 0.27.1, Kotlin 2.4.21, Gradle 9.8.2, AGP 9.4.1, Xcode 27.0

Thanks!

Activity

  1. self-assigned this
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions