Troubleshooting

Troubleshoot and resolve edge cases when using Sentry's Kotlin Multiplatform SDK.

This document covers common issues you may encounter when using the Sentry Kotlin Multiplatform SDK and provides steps to troubleshoot.

If you need additional help, ask on GitHub. Customers on a paid plan can also contact support.

Starting May 1, 2024, Apple requires all apps submitted to the App Store to provide a list of privacy-related APIs they use, including the reasons under which they use it. If you received an email from Apple with the message "ITMS-91053: Missing API declaration", your app doesn't fulfill the requirements. To solve this, follow our Apple Privacy Manifest guide.

If you configured the Sentry Kotlin Multiplatform SDK and tests are still failing with the following error: ld: framework 'Sentry' not found then follow these steps for the workaround:

This example shows you how to fix the issue for the iOS simulator target, but the same approach can be used for other targets.

1. Download the Sentry xcframework

2. Create a frameworks directory and insert Sentry.framework

Create a /Frameworks directory in the directory where the test.kexe resides and put the Sentry.framework in it.

  • The Sentry.framework can be found inside of the ios-arm64_x86_64-simulator.
  • The test.kexe will usually reside in build/bin/iosSimulatorArm64/debugTest.

3. Add linker options

Modify shared/build.gradle.kts to include linker options, as shown below:

shared/build.gradle.kts
Copied
  listOf(
      iosX64(),
      iosArm64(),
      iosSimulatorArm64(),
  ).forEach {
      it.binaries.framework {
          baseName = "shared"
      }
      it.compilations.all {
          if (compilationName == "test" && target.platformType == KotlinPlatformType.native) {
              compilerOptions.configure {
                  freeCompilerArgs.add("-linker-options")
                  freeCompilerArgs.add("-F/your/path/Carthage/Build/Sentry.xcframework/ios-arm64_x86_64-simulator/")
              }
          }
      }
  }

4. Run the tests

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").