Skip to content

Commit 65f104b

Browse files
fix: Unable to find class: SentryCrashExceptionApplication (#3957)
Added a reference SentryCrashExceptionApplication inside the SDK to prevent the compiler from stripping it. Co-authored-by: Philipp Hofmann <[email protected]>
1 parent 6ae86f6 commit 65f104b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Fix data race when calling reportFullyDisplayed from a background thread (#3926)
1212
- Ensure flushing envelopes directly after capturing them (#3915)
13+
- Unable to find class: SentryCrashExceptionApplication (#3957)
1314
- Clang error for Xcode 15.4 (#3958)
1415
- Potential deadlock when starting the SDK (#3970)
1516

Sources/Sentry/SentrySDK.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#import "SentryThreadWrapper.h"
2424
#import "SentryTransactionContext.h"
2525

26+
#if TARGET_OS_OSX
27+
# import "SentryCrashExceptionApplication.h"
28+
#endif // TARGET_OS_MAC
29+
2630
#if SENTRY_HAS_UIKIT
2731
# import "SentryUIDeviceWrapper.h"
2832
# import "SentryUIViewControllerPerformanceTracker.h"
@@ -200,6 +204,11 @@ + (void)startWithOptions:(SentryOptions *)options
200204
SENTRY_LOG_DEBUG(@"Configured options: %@", options.debugDescription);
201205
#endif // defined(DEBUG) || defined(TEST) || defined(TESTCI)
202206

207+
#if TARGET_OS_OSX
208+
// Reference to SentryCrashExceptionApplication to prevent compiler from stripping it
209+
[SentryCrashExceptionApplication sharedApplication];
210+
#endif
211+
203212
startInvocations++;
204213
startTimestamp = [SentryDependencyContainer.sharedInstance.dateProvider date];
205214

0 commit comments

Comments
 (0)