From c6d7879a38662d51119d97434ca8e92e462900ed Mon Sep 17 00:00:00 2001 From: GitHub Date: Mon, 3 Nov 2025 09:44:27 +0000 Subject: [PATCH 1/6] chore: update scripts/update-cocoa.sh to 8.57.1 --- CHANGELOG.md | 8 ++++++++ buildSrc/src/main/java/Config.kt | 2 +- .../gradle.properties | 2 +- .../sentry_kotlin_multiplatform.podspec | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e29c8f45..438271ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +### Dependencies + +- Bump Cocoa SDK from v8.55.1 to v8.57.1 ([#474](https://github.com/getsentry/sentry-kotlin-multiplatform/pull/474)) + - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8571) + - [diff](https://github.com/getsentry/sentry-cocoa/compare/8.55.1...8.57.1) + ## 0.20.0 ### Dependencies diff --git a/buildSrc/src/main/java/Config.kt b/buildSrc/src/main/java/Config.kt index d1e262ff..959dd86f 100644 --- a/buildSrc/src/main/java/Config.kt +++ b/buildSrc/src/main/java/Config.kt @@ -37,7 +37,7 @@ object Config { val sentryAndroid = "io.sentry:sentry-android:$sentryJavaVersion" val sentryJava = "io.sentry:sentry:$sentryJavaVersion" - val sentryCocoaVersion = "8.55.1" + val sentryCocoaVersion = "8.57.1" val sentryCocoa = "Sentry" object Samples { diff --git a/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties b/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties index 7c0d1418..c772fd19 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties +++ b/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties @@ -2,7 +2,7 @@ id=io.sentry.kotlin.multiplatform.gradle implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin versionName=0.20.0 group=io.sentry -sentryCocoaVersion=8.55.1 +sentryCocoaVersion=8.57.1 # publication pom properties POM_NAME=Sentry Kotlin Multiplatform Gradle Plugin diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec index 22b2a9ba..d75f42a1 100644 --- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec +++ b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec @@ -12,7 +12,7 @@ Pod::Spec.new do |spec| spec.osx.deployment_target = '10.13' spec.tvos.deployment_target = '11.0' spec.watchos.deployment_target = '4.0' - spec.dependency 'Sentry', '8.55.1' + spec.dependency 'Sentry', '8.57.1' if !Dir.exist?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework') || Dir.empty?('build/cocoapods/framework/sentry_kotlin_multiplatform.framework') raise " @@ -54,4 +54,4 @@ Pod::Spec.new do |spec| } ] -end \ No newline at end of file +end From ff329fee40c48bae2ef968977bb00443b6bbc72c Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 3 Nov 2025 13:13:51 +0100 Subject: [PATCH 2/6] Update used API --- .../sentry_kotlin_multiplatform.podspec | 2 +- .../nsexception/SentryUnhandledExceptions.kt | 20 ++++----- .../cinterop/Sentry.Internal.def | 2 +- .../cinterop/SentryInternal/SentryEnvelope.h | 42 ------------------- .../cinterop/SentryInternal/SentryEvent.h | 2 - .../SentryInternal/SentrySDKInternal.h | 3 +- .../kmp-app-cocoapods/shared/shared.podspec | 2 +- 7 files changed, 15 insertions(+), 58 deletions(-) delete mode 100644 sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h diff --git a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec index d75f42a1..2807c925 100644 --- a/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec +++ b/sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec @@ -54,4 +54,4 @@ Pod::Spec.new do |spec| } ] -end +end \ No newline at end of file diff --git a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt index c3bed646..047ca6b2 100644 --- a/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt +++ b/sentry-kotlin-multiplatform/src/appleMain/kotlin/io/sentry/kotlin/multiplatform/nsexception/SentryUnhandledExceptions.kt @@ -21,10 +21,7 @@ import platform.Foundation.NSNumber private typealias InternalSentryEvent = Internal.Sentry.SentryEvent private typealias InternalSentrySDK = Internal.Sentry.SentrySDKInternal -private typealias InternalSentryEnvelope = Internal.Sentry.SentryEnvelope private typealias InternalSentryDependencyContainer = Internal.Sentry.SentryDependencyContainer -private typealias InternalSentryEnvelopeHeader = Internal.Sentry.SentryEnvelopeHeader -private typealias InternalSentryEnvelopeItem = Internal.Sentry.SentryEnvelopeItem private typealias InternalSentryThreadInspector = Internal.Sentry.SentryThreadInspector private typealias CocoapodsSentryEvent = cocoapods.Sentry.SentryEvent @@ -33,6 +30,9 @@ private typealias CocoapodsSentryStacktrace = cocoapods.Sentry.SentryStacktrace private typealias CocoapodsSentryException = cocoapods.Sentry.SentryException private typealias CocoapodsSentryMechanism = cocoapods.Sentry.SentryMechanism private typealias CocoapodsSentryThread = cocoapods.Sentry.SentryThread +private typealias CocoapodsSentryEnvelope = cocoapods.Sentry.SentryEnvelope +private typealias CocoapodsSentryEnvelopeHeader = cocoapods.Sentry.SentryEnvelopeHeader +private typealias CocoapodsSentryEnvelopeItem = cocoapods.Sentry.SentryEnvelopeItem /** * Drops the Kotlin crash that follows an unhandled Kotlin exception except our custom SentryEvent. @@ -57,7 +57,7 @@ public fun setSentryUnhandledExceptionHook(): Unit = wrapUnhandledExceptionHook val envelope = throwable.asSentryEnvelope() // The envelope will be persisted, so we can safely terminate afterwards. // https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/SentryClient.m#L409 - InternalSentrySDK.storeEnvelope(envelope) + InternalSentrySDK.storeEnvelope(envelope as objcnames.classes.SentryEnvelope) CocoapodsSentrySDK.configureScope { scope -> scope?.setTagValue(KOTLIN_CRASH_TAG, KOTLIN_CRASH_TAG) } @@ -71,20 +71,20 @@ internal const val KOTLIN_CRASH_TAG = "nsexceptionkt.kotlin_crashed" /** * Converts `this` [Throwable] to a [SentryEnvelope]. */ -internal fun Throwable.asSentryEnvelope(): InternalSentryEnvelope { +private fun Throwable.asSentryEnvelope(): CocoapodsSentryEnvelope { val event = asSentryEvent() as InternalSentryEvent val preparedEvent = InternalSentrySDK.currentHub().let { hub -> hub.getClient() ?.prepareEvent(event, hub.scope, alwaysAttachStacktrace = false, isFatalEvent = true) } ?: event - val item = InternalSentryEnvelopeItem(preparedEvent) + val item = CocoapodsSentryEnvelopeItem(event = preparedEvent as cocoapods.Sentry.SentryEvent) // TODO: pass traceState when enabling performance monitoring for KMP SDK - val header = InternalSentryEnvelopeHeader(preparedEvent.eventId, null) - return InternalSentryEnvelope(header, listOf(item)) + val header = CocoapodsSentryEnvelopeHeader(id = preparedEvent.eventId) + return CocoapodsSentryEnvelope(header, listOf(item)) } /** - * Converts `this` [Throwable] to a [SentryEvent]. + * Converts `this` [Throwable] to a [cocoapods.Sentry.SentryEvent]. */ @Suppress("UnnecessaryOptInAnnotation") private fun Throwable.asSentryEvent(): CocoapodsSentryEvent = @@ -110,7 +110,7 @@ private fun Throwable.asSentryEvent(): CocoapodsSentryEvent = } /** - * Converts `this` [NSException] to a [SentryException]. + * Converts `this` [NSException] to a [io.sentry.kotlin.multiplatform.protocol.SentryException]. */ private fun NSException.asSentryException( threadId: NSNumber? diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def index cd487995..9eeed413 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def @@ -1,5 +1,5 @@ language = Objective-C -headers = SentryClient.h SentryDebugImageProvider.h SentryEnvelope.h \ SentryHub.h SentryScope.h \ +headers = SentryClient.h SentryEvent.h SentryDebugImageProvider.h \ SentryHub.h SentryScope.h \ SentryCrashMonitor_NSException.h SentryCrashMonitor_NSException+NSExceptionKt.h \ SentryCrashStackCursor.h SentryDependencyContainer.h SentryHook.h SentrySDKInternal.h \ SentryStacktraceBuilder.h SentryThreadInspector.h PrivateSentrySDKOnly.h \ diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h deleted file mode 100644 index fe737ec2..00000000 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEnvelope.h +++ /dev/null @@ -1,42 +0,0 @@ -// The following are snippets from the Sentry Cocoa SDK used to generate Kotlin stubs. -// -// https://github.com/getsentry/sentry-cocoa/blob/678172142ac1d10f5ed7978f69d16ab03e801057/Sources/Sentry/Public/SentryEnvelope.h -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Sentry -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. - -#import -#import - -@class SentryId, SentryTraceContext; - -@interface SentryEnvelopeHeader : NSObject - -- (instancetype)initWithId:(nullable SentryId *)eventId - traceContext:(nullable SentryTraceContext *)traceContext; - -@end - -@interface SentryEnvelopeItem : NSObject - -- (instancetype)initWithEvent:(SentryEvent *_Nonnull)event; - -@end - -@interface SentryEnvelope : NSObject - -- (instancetype)initWithHeader:(SentryEnvelopeHeader *_Nonnull)header - items:(NSArray *_Nonnull)items NS_DESIGNATED_INITIALIZER; - -@end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h index 600eae4c..741d4e6c 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentryEvent.h @@ -24,6 +24,4 @@ @property (nonatomic, assign) BOOL isFatalEvent; -@property (nonatomic, strong) SentryId *eventId; - @end diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDKInternal.h b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDKInternal.h index c6c9fffe..f90e83a3 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDKInternal.h +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/SentryInternal/SentrySDKInternal.h @@ -16,7 +16,8 @@ // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -#import +@class SentryEnvelope; + #import @interface SentrySDKInternal : NSObject diff --git a/sentry-samples/kmp-app-cocoapods/shared/shared.podspec b/sentry-samples/kmp-app-cocoapods/shared/shared.podspec index 2bf7fd4d..434148be 100644 --- a/sentry-samples/kmp-app-cocoapods/shared/shared.podspec +++ b/sentry-samples/kmp-app-cocoapods/shared/shared.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14.1' - spec.dependency 'Sentry', '8.55.1' + spec.dependency 'Sentry', '8.57.1' if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework') raise " From 8e90d32a1d3c242210bd467e9fd6dbc4e34175ab Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 3 Nov 2025 13:14:11 +0100 Subject: [PATCH 3/6] Clean up --- .../src/nativeInterop/cinterop/Sentry.Internal.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def index 9eeed413..03d115d4 100644 --- a/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def +++ b/sentry-kotlin-multiplatform/src/nativeInterop/cinterop/Sentry.Internal.def @@ -1,5 +1,5 @@ language = Objective-C -headers = SentryClient.h SentryEvent.h SentryDebugImageProvider.h \ SentryHub.h SentryScope.h \ +headers = SentryClient.h SentryEvent.h SentryDebugImageProvider.h SentryHub.h SentryScope.h \ SentryCrashMonitor_NSException.h SentryCrashMonitor_NSException+NSExceptionKt.h \ SentryCrashStackCursor.h SentryDependencyContainer.h SentryHook.h SentrySDKInternal.h \ SentryStacktraceBuilder.h SentryThreadInspector.h PrivateSentrySDKOnly.h \ From 43b96714437baef757c1b54cc86e6093d5bd6d3f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 3 Nov 2025 13:30:59 +0100 Subject: [PATCH 4/6] Update Sentry version in SPM sample --- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 32e7de61..1516435c 100644 --- a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/getsentry/sentry-cocoa.git", "state" : { - "revision" : "2c70925b98238b7efacde11d30075328c3cb6a2a", - "version" : "8.55.1" + "revision" : "e1e94efb9d5a688af85c607ae34a8b56961ca118", + "version" : "8.57.1" } } ], From bf4a70a3fbc6e12c192f695d90e8cc65422d3c30 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 3 Nov 2025 14:09:35 +0100 Subject: [PATCH 5/6] Update Sentry version in SPM sample --- sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj index b28dba98..36252cf4 100644 --- a/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj +++ b/sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj @@ -424,7 +424,7 @@ repositoryURL = "https://github.com/getsentry/sentry-cocoa.git"; requirement = { kind = exactVersion; - version = 8.55.1; + version = 8.57.1; }; }; /* End XCRemoteSwiftPackageReference section */ From bf338ef0552243235bd96b1d6448d03bfe1b515f Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 3 Nov 2025 14:47:33 +0100 Subject: [PATCH 6/6] Update --- sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock b/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock index 7fcd833a..1bf5b12c 100644 --- a/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock +++ b/sentry-samples/kmp-app-cocoapods/iosApp/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - Sentry (8.55.1): - - Sentry/Core (= 8.55.1) - - Sentry/Core (8.55.1) + - Sentry (8.57.1): + - Sentry/Core (= 8.57.1) + - Sentry/Core (8.57.1) - shared (1.0): - - Sentry (= 8.55.1) + - Sentry (= 8.57.1) DEPENDENCIES: - shared (from `../shared`) @@ -17,8 +17,8 @@ EXTERNAL SOURCES: :path: "../shared" SPEC CHECKSUMS: - Sentry: 6c92b12db0634612f6a66757890fea97e788fe12 - shared: 889fbc0d727dc0533f7fc04bee9d2d0418190291 + Sentry: ea4ca7cd1a46c77dcc8123804ce36d8f5603a841 + shared: 84e27d3ad161d8351fdb4f11eecf42fec2623cf8 PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756