Skip to content

Commit e449941

Browse files
committed
Merge branch 'main' into fix/flutter-multiview-support
* main: release: 8.8.0 chore: fix cocoa bump changelog (#2248) chore(deps): update Cocoa SDK to v8.35.1 (#2247) Provide a way to cause an example native crash from Flutter (#2239)
2 parents caf888c + 103eb14 commit e449941

28 files changed

+107
-48
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Changelog
22

3-
## Unreleased
3+
## 8.8.0
44

55
### Features
66

7+
- Add `SentryFlutter.nativeCrash()` using MethodChannels for Android and iOS ([#2239](https://github.com/getsentry/sentry-dart/pull/2239))
8+
- This can be used to test if native crash reporting works
79
- Add `ignoreRoutes` parameter to `SentryNavigatorObserver`. ([#2218](https://github.com/getsentry/sentry-dart/pull/2218))
810
- This will ignore the Routes and prevent the Route from being pushed to the Sentry server.
911
- Ignored routes will also create no TTID and TTFD spans.
@@ -17,6 +19,9 @@ SentryNavigatorObserver(ignoreRoutes: ["/ignoreThisRoute"]),
1719

1820
### Dependencies
1921

22+
- Bump Cocoa SDK from v8.33.0 to v8.35.1 ([#2247](https://github.com/getsentry/sentry-dart/pull/2247))
23+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8351)
24+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.33.0...8.35.1)
2025
- Bump Android SDK from v7.13.0 to v7.14.0 ([#2228](https://github.com/getsentry/sentry-dart/pull/2228))
2126
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7140)
2227
- [diff](https://github.com/getsentry/sentry-java/compare/7.13.0...7.14.0)

dart/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
library version;
1010

1111
/// The SDK version reported to Sentry.io in the submitted events.
12-
const String sdkVersion = '8.7.0';
12+
const String sdkVersion = '8.8.0';
1313

1414
String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName;
1515

dart/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sentry
2-
version: 8.7.0
2+
version: 8.8.0
33
description: >
44
A crash reporting library for Dart that sends crash reports to Sentry.io.
55
This library supports Dart VM and Web. For Flutter consider sentry_flutter instead.

dio/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.7.0';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_dio';

dio/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_dio
22
description: An integration which adds support for performance tracing for the Dio package.
3-
version: 8.7.0
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/dart/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -19,7 +19,7 @@ platforms:
1919

2020
dependencies:
2121
dio: ^5.0.0
22-
sentry: 8.7.0
22+
sentry: 8.8.0
2323

2424
dev_dependencies:
2525
meta: ^1.3.0

drift/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.7.0';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_drift';

drift/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_drift
22
description: An integration which adds support for performance tracing for the drift package.
3-
version: 8.7.0
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/flutter/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -17,7 +17,7 @@ platforms:
1717
web:
1818

1919
dependencies:
20-
sentry: 8.7.0
20+
sentry: 8.8.0
2121
meta: ^1.3.0
2222
drift: ^2.13.0
2323

file/lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// The SDK version reported to Sentry.io in the submitted events.
2-
const String sdkVersion = '8.7.0';
2+
const String sdkVersion = '8.8.0';
33

44
/// The package name reported to Sentry.io in the submitted events.
55
const String packageName = 'pub:sentry_file';

file/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: sentry_file
22
description: An integration which adds support for performance tracing for dart.io.File.
3-
version: 8.7.0
3+
version: 8.8.0
44
homepage: https://docs.sentry.io/platforms/dart/
55
repository: https://github.com/getsentry/sentry-dart
66
issue_tracker: https://github.com/getsentry/sentry-dart/issues
@@ -17,7 +17,7 @@ platforms:
1717
windows:
1818

1919
dependencies:
20-
sentry: 8.7.0
20+
sentry: 8.8.0
2121
meta: ^1.3.0
2222

2323
dev_dependencies:

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package io.sentry.flutter
33
import android.app.Activity
44
import android.content.Context
55
import android.os.Build
6+
import android.os.Looper
67
import android.util.Log
78
import io.flutter.embedding.engine.plugins.FlutterPlugin
89
import io.flutter.embedding.engine.plugins.activity.ActivityAware
@@ -49,8 +50,8 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
4950

5051
sentryFlutter =
5152
SentryFlutter(
52-
androidSdk = androidSdk,
53-
nativeSdk = nativeSdk,
53+
androidSdk = ANDROID_SDK,
54+
nativeSdk = NATIVE_SDK,
5455
)
5556
}
5657

@@ -74,6 +75,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
7475
"removeTag" -> removeTag(call.argument("key"), result)
7576
"loadContexts" -> loadContexts(result)
7677
"displayRefreshRate" -> displayRefreshRate(result)
78+
"nativeCrash" -> crash()
7779
else -> result.notImplemented()
7880
}
7981
}
@@ -413,16 +415,17 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
413415
}
414416

415417
companion object {
418+
private const val FLUTTER_SDK = "sentry.dart.flutter"
419+
private const val ANDROID_SDK = "sentry.java.android.flutter"
420+
private const val NATIVE_SDK = "sentry.native.android.flutter"
421+
private const val NATIVE_CRASH_WAIT_TIME = 500L
416422

417-
private const val flutterSdk = "sentry.dart.flutter"
418-
private const val androidSdk = "sentry.java.android.flutter"
419-
private const val nativeSdk = "sentry.native.android.flutter"
420423
private fun setEventOriginTag(event: SentryEvent) {
421424
event.sdk?.let {
422425
when (it.name) {
423-
flutterSdk -> setEventEnvironmentTag(event, "flutter", "dart")
424-
androidSdk -> setEventEnvironmentTag(event, environment = "java")
425-
nativeSdk -> setEventEnvironmentTag(event, environment = "native")
426+
FLUTTER_SDK -> setEventEnvironmentTag(event, "flutter", "dart")
427+
ANDROID_SDK -> setEventEnvironmentTag(event, environment = "java")
428+
NATIVE_SDK -> setEventEnvironmentTag(event, environment = "native")
426429
else -> return
427430
}
428431
}
@@ -439,7 +442,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
439442

440443
private fun addPackages(event: SentryEvent, sdk: SdkVersion?) {
441444
event.sdk?.let {
442-
if (it.name == flutterSdk) {
445+
if (it.name == FLUTTER_SDK) {
443446
sdk?.packageSet?.forEach { sentryPackage ->
444447
it.addPackage(sentryPackage.name, sentryPackage.version)
445448
}
@@ -449,6 +452,13 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
449452
}
450453
}
451454
}
455+
456+
private fun crash() {
457+
val exception = RuntimeException("FlutterSentry Native Integration: Sample RuntimeException")
458+
val mainThread = Looper.getMainLooper().thread
459+
mainThread.uncaughtExceptionHandler.uncaughtException(mainThread, exception)
460+
mainThread.join(NATIVE_CRASH_WAIT_TIME)
461+
}
452462
}
453463

454464
private fun loadContexts(result: Result) {

0 commit comments

Comments
 (0)