From cbee1f9c5379a7ac3b50a8b13741f34ed5c63a06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:34:37 +0100 Subject: [PATCH] chore(deps): update Android SDK to v7.3.0 (#3434) Co-authored-by: Krystof Woldrich --- CHANGELOG.md | 15 ++++++++++++++- android/build.gradle | 2 +- .../io/sentry/react/RNSentryModuleImpl.java | 17 ++++++----------- samples/react-native/android/build.gradle | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4655ed51d..86a542d32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## Unreleased + +This release contains upgrade of `sentry-android` dependency to major version 7. There are no breaking changes in the JS API. If you are using the Android API please check [the migration guide](https://docs.sentry.io/platforms/android/migration/#migrating-from-iosentrysentry-android-6x-to-iosentrysentry-android-700). + +### Fixes + +- Upload Debug Symbols Build Phase continues when `node` not found in `WITH_ENVIRONMENT` ([#3573](https://github.com/getsentry/sentry-react-native/pull/3573)) + +### Dependencies + +- Bump Android SDK from v6.34.0 to v7.3.0 ([#3434](https://github.com/getsentry/sentry-react-native/pull/3434)) + - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#730) + - [diff](https://github.com/getsentry/sentry-java/compare/6.34.0...7.3.0) + ## 5.18.0 ### Features @@ -26,7 +40,6 @@ - Fetch Organization slug from `@sentry/react-native/expo` config when uploading artifacts ([#3557](https://github.com/getsentry/sentry-react-native/pull/3557)) - Remove 404 Http Client Errors reports for Metro Dev Server Requests ([#3553](https://github.com/getsentry/sentry-react-native/pull/3553)) - Stop tracing Spotlight Sidecar network request in JS ([#3559](https://github.com/getsentry/sentry-react-native/pull/3559)) -- Upload Debug Symbols Build Phase continues when `node` not found in `WITH_ENVIRONMENT` ([#3573](https://github.com/getsentry/sentry-react-native/pull/3573)) ## 5.17.0 diff --git a/android/build.gradle b/android/build.gradle index 6eb462289..992a03841 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -54,5 +54,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'io.sentry:sentry-android:6.34.0' + api 'io.sentry:sentry-android:7.3.0' } diff --git a/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java b/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java index 2c0372690..9b2905024 100644 --- a/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java +++ b/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java @@ -15,7 +15,6 @@ import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.ReadableMapKeySetIterator; import com.facebook.react.bridge.UiThreadUtil; @@ -31,7 +30,6 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.FileReader; import java.io.InputStream; import java.nio.charset.Charset; @@ -45,9 +43,9 @@ import io.sentry.DateUtils; import io.sentry.HubAdapter; import io.sentry.ILogger; +import io.sentry.IScope; import io.sentry.ISerializer; import io.sentry.Integration; -import io.sentry.Scope; import io.sentry.Sentry; import io.sentry.SentryDate; import io.sentry.SentryEvent; @@ -56,7 +54,6 @@ import io.sentry.UncaughtExceptionHandlerIntegration; import io.sentry.android.core.AndroidLogger; import io.sentry.android.core.AnrIntegration; -import io.sentry.android.core.AppStartState; import io.sentry.android.core.BuildConfig; import io.sentry.android.core.BuildInfoProvider; import io.sentry.android.core.CurrentActivityHolder; @@ -65,6 +62,7 @@ import io.sentry.android.core.SentryAndroid; import io.sentry.android.core.SentryAndroidOptions; import io.sentry.android.core.ViewHierarchyEventProcessor; +import io.sentry.android.core.performance.AppStartMetrics; import io.sentry.protocol.SdkVersion; import io.sentry.protocol.SentryException; import io.sentry.protocol.SentryPackage; @@ -261,16 +259,13 @@ public void fetchNativeRelease(Promise promise) { } public void fetchNativeAppStart(Promise promise) { - final AppStartState appStartInstance = AppStartState.getInstance(); - final SentryDate appStartTime = appStartInstance.getAppStartTime(); - final Boolean isColdStart = appStartInstance.isColdStart(); + final AppStartMetrics appStartInstance = AppStartMetrics.getInstance(); + final SentryDate appStartTime = appStartInstance.getAppStartTimeSpan().getStartTimestamp(); + final boolean isColdStart = appStartInstance.getAppStartType() == AppStartMetrics.AppStartType.COLD; if (appStartTime == null) { logger.log(SentryLevel.WARNING, "App start won't be sent due to missing appStartTime."); promise.resolve(null); - } else if (isColdStart == null) { - logger.log(SentryLevel.WARNING, "App start won't be sent due to missing isColdStart."); - promise.resolve(null); } else { final double appStartTimestampMs = DateUtils.nanosToMillis(appStartTime.nanoTimestamp()); @@ -684,7 +679,7 @@ public void fetchNativeDeviceContexts(Promise promise) { return; } - final @Nullable Scope currentScope = InternalSentrySdk.getCurrentScope(); + final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope(); final @NotNull Map serialized = InternalSentrySdk.serializeScope( context, (SentryAndroidOptions) options, diff --git a/samples/react-native/android/build.gradle b/samples/react-native/android/build.gradle index 0fec2fece..16062c883 100644 --- a/samples/react-native/android/build.gradle +++ b/samples/react-native/android/build.gradle @@ -16,7 +16,7 @@ buildscript { classpath("com.android.tools.build:gradle") classpath("com.facebook.react:react-native-gradle-plugin") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") - classpath("io.sentry:sentry-android-gradle-plugin:3.11.1") + classpath("io.sentry:sentry-android-gradle-plugin:4.2.0") } }