getsentry / sentry-kotlin-multiplatform

Sentry SDK for Kotlin Multiplatform
MIT License
131 stars 19 forks source link

XCode build fails due to XCFramework names issue #255

Open oblakr24 opened 3 weeks ago

oblakr24 commented 3 weeks ago

Problem Statement

My main issue is that it is unclear to me which Kotlin version is supported, specifically for iOS. Android and JVM work fine.

For iOS, the installation instructions do not work for me as I keep getting issues during the XCode build:

All inner frameworks in XCFramework 'composeApp' should have same names. But there are two with 'composeApp' and 'shared' names

My cocoapods block:

   cocoapods {
        // Required properties
        // Specify the required Pod version here. Otherwise, the Gradle project version is used.
        version = "1.0"
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"

        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        // Make sure you use the proper version according to our Cocoa SDK Version Compatibility Table.
        pod("Sentry") {
            version = "~> 8.25"
            linkOnly = true
            moduleName = "Sentry"
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
        framework {
            baseName = "shared"
        }
    }

If I try to name this framework as composeApp, then I get another error:

'embedAndSign' task can not be used in a project with dependencies to pods.

Solution Brainstorm

No response

buenaflor commented 3 weeks ago

hey, what kotlin version are you using?

oblakr24 commented 3 weeks ago

@buenaflor hi, I tried with 2.0.0 and 2.0.10

buenaflor commented 3 weeks ago

Thx for the quick response, I'll check it out and get back to you! there may be something wrong though since we still use 1.9.23.

Do you know if it works on a KMP only project for you? as far as I can see you're also using compose multiplatform

oblakr24 commented 2 weeks ago

Hi, unfortunately i did not try KMP only, but it might be the same issue there, just that the error would complain about a different name (ComposeApp is the default framework name from the wizard for Compose Multiplatform).