Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build iOS project (undefined symbol _OBJC_CLASS_$_CMPAccessibilityContainer) with 1.6.11 #5059

Open
DJ-LEE11 opened this issue Jul 3, 2024 · 0 comments
Labels
bug Something isn't working submitted

Comments

@DJ-LEE11
Copy link

DJ-LEE11 commented Jul 3, 2024

Describe the bug
Undefined symbol when Build iOS project(OBJC_CLASS$_CMPAccessibilityContainer).

Affected platforms

  • iOS

Versions

  • Libraries:
    • Compose Multiplatform version: 1.6.11
  • Kotlin version: 2.0.0
  • OS version(s) (required for Desktop and iOS issues): MacOS 13.5.2,iOS 13.0
  • OS architecture (x86 or arm64): arm64
  • xCode version:15.0

Full output
11:26:31 ld: warning: object file (/opt/data/DUOWAN_BUILD/bdgameassist/assist_2.73_kmm_feature/Pods/ultron/libs/libultron.a[arm64]67) was built for newer 'iOS' version (13.2) than being linked (13.0)
11:26:31 ld: warning: object file (/opt/data/DUOWAN_BUILD/bdgameassist/assist_2.73_kmm_feature/Pods/ultron/libs/libultron.a[arm64]68) was built for newer 'iOS' version (13.2) than being linked (13.0)
11:26:31 ld: warning: Could not find or use auto-linked framework 'AFNetworking': framework 'AFNetworking' not found
11:26:31 ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
11:26:31 ld: warning: Could not find or use auto-linked framework 'TYRZSDK': framework 'TYRZSDK' not found
11:26:31 ld: Undefined symbols:
11:26:31 OBJC_CLASS$_CMPAccessibilityContainer, referenced from:
11:26:31 in bdgameshared[arm64]2
11:26:31 OBJC_CLASS$_CMPAccessibilityElement, referenced from:
11:26:31 in bdgameshared[arm64]2
11:26:31 OBJC_CLASS$_CMPEditMenuView, referenced from:
11:26:31 in bdgameshared[arm64]2
11:26:31 OBJC_CLASS$_CMPInteropWrappingView, referenced from:
11:26:31 in bdgameshared[arm64]2
11:26:31 OBJC_CLASS$_CMPViewController, referenced from:
11:26:31 in bdgameshared[arm64]2
11:26:31
clang: error: linker command failed with exit code 1 (use -v to see invocation)

KMM build.gradle
kotlin {
...

listOf(
    iosArm64(),
).forEach {
    val main by it.compilations.getting {
        val fixUndefinedSymbols by cinterops.creating {
            defFile(project.file("src/iosArm64Main/cinterop/fix_undefined_symbols.def"))
        }
    }
    it.binaries.framework {
        baseName = artifactName
        isStatic = true
        transitiveExport = true
        export("tv.athena.baizhankmm:basesdk:${properties["kmm_basesdk"]}")
        export("tv.athena.bdgamekmm:homepageapi:${properties["kmm_homepage"]}")
        export("tv.athena.bdgamekmm:baseliveapi:${properties["kmm_baselive"]}")
    }
}

val publicationsFromMainHost =
    listOf(
        iosArm64(),
    ).map { it.name } + "kotlinMultiplatform"

if (version.toString().contains("SNAPSHOT")) {
    logger.log(LogLevel.INFO, "current is testing version")
} else {
    logger.log(LogLevel.INFO, "current is release version")
}

publishing {
    publications {
        matching { it.name in publicationsFromMainHost }.all {
            val targetPublication = this@all
            tasks.withType<AbstractPublishToMaven>()
                .matching { it.publication == targetPublication }
                .configureEach { onlyIf { false } }
        }
    }
}

// Create a task to build a framework.
tasks.register<FatFrameworkTask>("releaseIOSFramework") {
    baseName = artifactName
    destinationDir = buildDir.resolve("ios_frameworks")
    from(
        iosArm64().binaries.getFramework("RELEASE")
    )
}

targets.withType<KotlinNativeTarget> {
    binaries.all {
        freeCompilerArgs += "-Xgc=cms"
        freeCompilerArgs += "-Xpurge-user-libs"
        freeCompilerArgs += "-Xno-inline"
        freeCompilerArgs += "-Xoverride-konan-properties=clangOptFlags.ios_arm64=-Oz -flto=full"
        freeCompilerArgs += "-Xexport-kdoc"
    }
}
...

}

@DJ-LEE11 DJ-LEE11 added bug Something isn't working submitted labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working submitted
Projects
None yet
Development

No branches or pull requests

1 participant