Cocoapods

To install the Kotlin Multiplatform SDK and setup your Apple targets with Cocoapods, you need to add the following to your build.gradle.kts file in your shared module:

shared/build.gradle.kts
Copied
repositories {
    mavenCentral()
}

kotlin {
  iosX64()
  iosArm64()
  iosSimulatorArm64()

  sourceSets {
    val commonMain by getting {
      dependencies {
        implementation("io.sentry:sentry-kotlin-multiplatform:0.2.1")
      }
    }

    // Other targets...

    // Apple targets:
    val iosMain by getting {
      dependsOn(commonMain)
    }

    cocoapods {
      summary = "Some description for the Shared Module"
      homepage = "Link to the Shared Module homepage"
      ios.deploymentTarget = "14.1"
      podfile = project.file("../iosApp/Podfile")
      pod("Sentry", "~> 8.4.0")

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