From 0fadf67862558877d93074a8baedba0fa483e494 Mon Sep 17 00:00:00 2001 From: GitHub Date: Mon, 5 Feb 2024 08:38:58 +0000 Subject: [PATCH 1/2] chore: update scripts/update-android.sh to 7.3.0 --- CHANGELOG.md | 8 ++++++++ android/build.gradle | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4655ed51d3..25f63c3214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## Unreleased + +### 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 diff --git a/android/build.gradle b/android/build.gradle index 6eb462289e..992a038412 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' } From 5a6758fe45965fe71f90185f93beadd08babb307 Mon Sep 17 00:00:00 2001 From: Krystof Woldrich Date: Mon, 5 Feb 2024 13:01:43 +0100 Subject: [PATCH 2/2] fix breaking android changes --- CHANGELOG.md | 7 ++++++- .../io/sentry/react/RNSentryModuleImpl.java | 17 ++++++----------- samples/react-native/android/build.gradle | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25f63c3214..86a542d326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## 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)) @@ -34,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/src/main/java/io/sentry/react/RNSentryModuleImpl.java b/android/src/main/java/io/sentry/react/RNSentryModuleImpl.java index 2c0372690b..9b2905024e 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 0fec2fece9..16062c8838 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") } }