Groo

Kotlin Multiplatform iOS 애플리케이션 빌드시 Task :shared:linkDebugFrameworkIosX64 오류 해결법 본문

Kotlin Multiplatform

Kotlin Multiplatform iOS 애플리케이션 빌드시 Task :shared:linkDebugFrameworkIosX64 오류 해결법

김주엽 2024. 1. 14. 20:35

KMP 프로젝트를 생성하고 iOS 애플리케이션을 빌드했는데 아래처럼 오류가 발생했어요. 코드에는 문제가 없었고 시뮬레이터를 새로 설치해도 해결되지 않았어요.

> Task :shared:linkDebugFrameworkIosX64 FAILED
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
    
    kotlin.native.cacheKind.iosX64=none
    
Also, consider filing an issue with full Gradle log here: https://kotl.in/issue
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: unknown options: -ios_simulator_version_min -sdk_version 
error: Compilation finished with errors

FAILURE: Build failed with an exception.

...

The following build commands failed:
	PhaseScriptExecution Run\ Script /Users/juyeop/Downloads/test/build/ios/iosApp.build/Debug-iphonesimulator/iosApp.build/Script-7555FFB5242A651A00829871.sh (in target 'iosApp' from project 'iosApp')

관련해서 구글링을 해보니 Xcode 15와 Kotlin 버전간의 문제였네요. Kotlin 1.9.10 버전에서 해결 되었다고 하니 Kotlin 버전을 수정해서 문제를 해결해보세요.

plugins {
    ...

    kotlin("android").version("1.9.10").apply(false)
    kotlin("multiplatform").version("1.9.10").apply(false)
}

Kotlin 버전을 올리면 Compose 버전도 같이 확인을 해주어야 한다는점 잊지마세요.

android {
    ...

    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.3"
    }
}

글 작성시 참고한 문서

Comments