sentry-kotlin-multiplatform icon indicating copy to clipboard operation
sentry-kotlin-multiplatform copied to clipboard

How to add debug symbols upload

Open T8RIN opened this issue 4 months ago • 8 comments

Description

I followed this tutorial https://docs.sentry.io/platforms/kotlin/guides/kotlin-multiplatform/debug-symbols/

but it didn't work at all

Caused by: org.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException: No matching variant of io.sentry:sentry-kotlin-extensions:8.14.0 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:

  • Variant 'apiElements' declares a library for use during compile-time, preferably optimized for standard JVMs:
    • Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
    • Other compatible attribute:
      • Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_arm64')

This build error occures after adding sentry android plugin along with sentry kmp plugin

T8RIN avatar Aug 08 '25 15:08 T8RIN

@T8RIN it looks like you're applying the plugin to the shared module shared/build.gradle.kts instead of the build gradle file within your native Android module

buenaflor avatar Aug 08 '25 15:08 buenaflor

yes, it is, but i have no android module, we have only one shared build.gradle.kts

T8RIN avatar Aug 08 '25 15:08 T8RIN

I assume you have an Android app (even if in another repository) that consumes your KMP framework

then you need to apply the gradle plugin (id("io.sentry.android.gradle") version "5.8.1") to the Android app directly

buenaflor avatar Aug 08 '25 15:08 buenaflor

i have kmp app, it have only shared build gradle and no separate modules, so all setup to android and ios comes in this shared build gradle of composeApp module

T8RIN avatar Aug 08 '25 15:08 T8RIN

if it's a compose multiplatform app then you should instead read the Compose Multiplatform guide: https://docs.sentry.io/platforms/kotlin/guides/compose-multiplatform/#debug-symbols

the steps here are different for Android than on a pure KMP app

buenaflor avatar Aug 08 '25 15:08 buenaflor

I haven't adjusted the guide yet but you need to pass the UUID for the proguard file in Sentry.init via the proguardUuid option

buenaflor avatar Aug 08 '25 15:08 buenaflor

Okay thanks, i will look

T8RIN avatar Aug 08 '25 16:08 T8RIN