|
1 | 1 | <p align="center">
|
2 |
| - <a href="https://sentry.io" target="_blank" align="center"> |
3 |
| - <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280"> |
4 |
| - </a> |
| 2 | + <picture> |
| 3 | + <source media="(prefers-color-scheme: dark)" srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-white.png"> |
| 4 | + <source media="(prefers-color-scheme: light)" srcset="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png"> |
| 5 | + <img alt="Shows a black logo in light color mode and a white one in dark color mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png" width="280"> |
| 6 | + </picture> |
5 | 7 | <br/>
|
6 | 8 | <h1>Experimental Sentry SDK for Kotlin Multiplatform</h1>
|
7 | 9 | </p>
|
8 | 10 |
|
9 | 11 | This project is an experimental SDK for Kotlin Multiplatform.
|
10 |
| -This SDK is a wrapper around different platforms such as JVM, Android, Cocoa that can be used on Kotlin Multiplatform. |
| 12 | +This SDK is a wrapper around different platforms such as JVM, Android, iOS, macOS, watchOS, tvOS that can be used on Kotlin Multiplatform. |
11 | 13 |
|
12 |
| -## Installation |
| 14 | +## Supported Platforms |
13 | 15 |
|
14 |
| -Clone or fork this repo. This SDK is under construction and therefore we only currently publish it to maven local: |
| 16 | +| Target Platform | Target preset | |
| 17 | +|:-------------:|-------------| |
| 18 | +| Android | <ul><li>`android`</li></ul> | |
| 19 | +| Kotlin/JVM | <ul><li>`jvm`</li></ul> |
| 20 | +| iOS | <ul><li>`iosArm64`</li><li>`iosX64`</li><li>`iosSimulatorArm64`</li></ul>| |
| 21 | +| macOS | <ul><li>`macosArm64`</li><li>`macosX64`</ul>| |
| 22 | +| watchOS | <ul><li>`watchosArm32`</li><li>`watchosArm64`</li><li>`watchosX64`</li><li>`watchosSimulatorArm64`</li></ul>| |
| 23 | +| tvOS | <ul><li>`tvosArm64`</li><li>`tvosX64`</li><li>`tvosSimulatorArm64`</li></ul>| |
15 | 24 |
|
16 |
| -```sh |
17 |
| -./gradlew publishToMavenLocal |
18 |
| -``` |
| 25 | +## Configure Repository |
19 | 26 |
|
20 |
| -### Shared Module |
21 |
| -In your `build.gradle` of your shared module |
| 27 | +The Kotlin Multiplatform SDK is available in the Maven central repository. You can declare this repository in your build script as follows: |
22 | 28 |
|
23 | 29 | ```gradle
|
24 | 30 | repositories {
|
25 |
| - // Because we only publish to maven local |
26 |
| - mavenLocal() |
| 31 | + mavenCentral() |
27 | 32 | }
|
28 | 33 | ```
|
29 | 34 |
|
30 |
| -Add this to your `commonMain` sourceSet. |
| 35 | +## Add dependency |
| 36 | +For a multiplatform project, you need to add the sentry-kotlin-multiplatform artifact to the `commonMain` source set: |
31 | 37 |
|
32 |
| -```gradle |
33 |
| -// Add this dependency to your commonMain sourceSet |
34 |
| -dependencies { |
35 |
| - api("io.sentry:sentry-kotlin-multiplatform:0.0.1") |
| 38 | +```Kotlin |
| 39 | +val commonMain by getting { |
| 40 | + dependencies { |
| 41 | + api("io.sentry:sentry-kotlin-multiplatform:0.0.1") |
| 42 | + } |
36 | 43 | }
|
37 |
| -
|
38 | 44 | ```
|
39 | 45 |
|
40 | 46 | ### Cocoa
|
41 | 47 |
|
42 |
| -For iOS, iPadOS, MacOS, tvOS or watchOS we use CocoaPods to include [sentry-cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK. |
43 |
| -One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension. |
| 48 | +If you are targeting Apple platforms (iOS, macOS, watchOS, tvOS), then you need to use CocoaPods to include [Sentry Cocoa](https://github.com/getsentry/sentry-cocoa) into this SDK. |
| 49 | +One way to achieve this is to include the Sentry Cocoa SDK via the Kotlin CocoaPods extension. Be aware that your Sentry Cocoa version has to match the SDK's version. Currently the supported version is `~> 7.21.0` |
44 | 50 |
|
45 | 51 | ```gradle
|
46 | 52 | cocoapods {
|
47 | 53 | // ...
|
48 | 54 |
|
49 |
| - // Make sure this is the same version as the one used in the SDK |
| 55 | + // Make sure Sentry Cocoa in your project matches this version |
50 | 56 | pod("Sentry", "~> 7.21.0")
|
51 | 57 |
|
52 | 58 | framework {
|
@@ -150,3 +156,19 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
150 | 156 | }
|
151 | 157 | }
|
152 | 158 | ```
|
| 159 | + |
| 160 | +## Debug Symbols for Apple targets |
| 161 | + |
| 162 | +A dSYM upload is required for Sentry to symbolicate your crash logs for viewing. The symbolication process unscrambles Apple’s crash logs to reveal the function, variables, file names, and line numbers of the crash. The dSYM file can be uploaded through the sentry-cli tool or through a Fastlane action. Please visit our [sentry.io guide](https://docs.sentry.io/clients/cocoa/dsym/) to get started on uploading debug symbols. |
| 163 | + |
| 164 | + ## Troubleshooting |
| 165 | + |
| 166 | + `WARNING: CocoaPods requires your terminal to be using UTF-8 encoding. |
| 167 | + Consider adding the following to ~/.profile: |
| 168 | + export LANG=en_US.UTF-8` |
| 169 | + |
| 170 | + This is a known problem and can easily be fixed as described in this [Stack Overflow post](https://stackoverflow.com/a/69395720) |
| 171 | + |
| 172 | + ## Contribution |
| 173 | + |
| 174 | + Please see the [contribution guide](https://github.com/getsentry/sentry-kotlin-multiplatform/blob/main/CONTRIBUTING.md) before contributing |
0 commit comments