Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Fixes Android SDK v8 breakages and deprecations #4490

Open
wants to merge 19 commits into
base: deps/scripts/update-android.sh
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d2b541e
chore: update scripts/update-android.sh to 8.0.0
web-flow Jan 27, 2025
bcdad66
Remove user segment
antonis Jan 28, 2025
fa6ffeb
Update AndroidProfiler constructor
antonis Jan 28, 2025
40f4fab
Use getPackageSet instead of getPackages
antonis Jan 28, 2025
0828c2b
Use getIntegrationSet instead of getIntegrations
antonis Jan 28, 2025
140ba26
Replace Hub with Scopes
antonis Jan 28, 2025
0316113
chore: update scripts/update-android.sh to 8.0.0
web-flow Jan 29, 2025
5496d80
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Jan 29, 2025
246e13b
chore: update scripts/update-android.sh to 8.1.0
web-flow Jan 31, 2025
0d54111
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Jan 31, 2025
6f276a6
chore: update scripts/update-android.sh to 8.1.0
web-flow Jan 31, 2025
54130d9
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Feb 3, 2025
ac72161
chore: update scripts/update-android.sh to 8.1.0
web-flow Feb 3, 2025
c33a076
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Feb 3, 2025
65f3705
chore: update scripts/update-android.sh to 8.1.0
web-flow Feb 3, 2025
97bce9c
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Feb 3, 2025
159502e
chore: update scripts/update-android.sh to 8.1.0
web-flow Feb 4, 2025
5ad4eef
Merge branch 'deps/scripts/update-android.sh' into antonis/android-sdk-8
antonis Feb 4, 2025
ea58c24
Revert changelog change after merge
antonis Feb 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
- Bump JavaScript SDK from v8.47.0 to v8.52.0 ([#4421](https://github.com/getsentry/sentry-react-native/pull/4421), [#4449](https://github.com/getsentry/sentry-react-native/pull/4449), [#4453](https://github.com/getsentry/sentry-react-native/pull/4453), [#4480](https://github.com/getsentry/sentry-react-native/pull/4480), [#4491](https://github.com/getsentry/sentry-react-native/pull/4491))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#8520)
- [diff](https://github.com/getsentry/sentry-javascript/compare/8.47.0...8.52.0)
- Bump Android SDK from v7.20.0 to v7.20.1 ([#4467](https://github.com/getsentry/sentry-react-native/pull/4467))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7201)
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.0...7.20.1)
- Bump Android SDK from v7.20.0 to v8.0.0 ([#4467](https://github.com/getsentry/sentry-react-native/pull/4467), [#4471](https://github.com/getsentry/sentry-react-native/pull/4471))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#800)
- [diff](https://github.com/getsentry/sentry-java/compare/7.20.0...8.0.0)

## 6.5.0

Expand Down
2 changes: 1 addition & 1 deletion packages/core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ android {

dependencies {
implementation 'com.facebook.react:react-native:+'
api 'io.sentry:sentry-android:7.20.1'
api 'io.sentry:sentry-android:8.0.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
import com.facebook.react.common.JavascriptException;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import io.sentry.Breadcrumb;
import io.sentry.HubAdapter;
import io.sentry.ILogger;
import io.sentry.IScope;
import io.sentry.ISentryExecutorService;
import io.sentry.ISerializer;
import io.sentry.Integration;
import io.sentry.ScopesAdapter;
import io.sentry.Sentry;
import io.sentry.SentryDate;
import io.sentry.SentryDateProvider;
Expand Down Expand Up @@ -85,6 +85,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -505,7 +506,7 @@ public void fetchNativeFrames(Promise promise) {
}

public void captureReplay(boolean isHardCrash, Promise promise) {
Sentry.getCurrentHub().getOptions().getReplayController().captureReplay(isHardCrash);
Sentry.getCurrentScopes().getOptions().getReplayController().captureReplay(isHardCrash);
promise.resolve(getCurrentReplayId());
}

Expand Down Expand Up @@ -601,7 +602,7 @@ public void fetchViewHierarchy(Promise promise) {
return;
}

ISerializer serializer = HubAdapter.getInstance().getOptions().getSerializer();
ISerializer serializer = ScopesAdapter.getInstance().getOptions().getSerializer();
final @Nullable byte[] bytes =
JsonSerializationUtils.bytesFrom(serializer, logger, viewHierarchy);
if (bytes == null) {
Expand Down Expand Up @@ -655,10 +656,6 @@ public void setUser(final ReadableMap userKeys, final ReadableMap userDataKeys)
if (userKeys.hasKey("ip_address")) {
userInstance.setIpAddress(userKeys.getString("ip_address"));
}

if (userKeys.hasKey("segment")) {
userInstance.setSegment(userKeys.getString("segment"));
}
}

if (userDataKeys != null) {
Expand Down Expand Up @@ -807,8 +804,7 @@ private void initializeAndroidProfiler() {
(int) SECONDS.toMicros(1) / profilingTracesHz,
new SentryFrameMetricsCollector(reactApplicationContext, logger, buildInfo),
executorService,
logger,
buildInfo);
logger);
}

public WritableMap startProfiling(boolean platformProfilers) {
Expand All @@ -832,7 +828,7 @@ public WritableMap startProfiling(boolean platformProfilers) {
}

public WritableMap stopProfiling() {
final boolean isDebug = HubAdapter.getInstance().getOptions().isDebug();
final boolean isDebug = ScopesAdapter.getInstance().getOptions().isDebug();
final WritableMap result = new WritableNativeMap();
File output = null;
try {
Expand Down Expand Up @@ -918,7 +914,7 @@ private String readStringFromFile(File path) throws IOException {
}

public void fetchNativeDeviceContexts(Promise promise) {
final @NotNull SentryOptions options = HubAdapter.getInstance().getOptions();
final @NotNull SentryOptions options = ScopesAdapter.getInstance().getOptions();
final @Nullable Context context = this.getReactApplicationContext().getApplicationContext();
final @Nullable IScope currentScope = InternalSentrySdk.getCurrentScope();
fetchNativeDeviceContexts(promise, options, context, currentScope);
Expand Down Expand Up @@ -955,7 +951,8 @@ protected void fetchNativeDeviceContexts(
}

public void fetchNativeSdkInfo(Promise promise) {
final @Nullable SdkVersion sdkVersion = HubAdapter.getInstance().getOptions().getSdkVersion();
final @Nullable SdkVersion sdkVersion =
ScopesAdapter.getInstance().getOptions().getSdkVersion();
if (sdkVersion == null) {
promise.resolve(null);
} else {
Expand Down Expand Up @@ -1001,14 +998,14 @@ private void addPackages(SentryEvent event, SdkVersion sdk) {
if (eventSdk != null
&& "sentry.javascript.react-native".equals(eventSdk.getName())
&& sdk != null) {
List<SentryPackage> sentryPackages = sdk.getPackages();
Set<SentryPackage> sentryPackages = sdk.getPackageSet();
if (sentryPackages != null) {
for (SentryPackage sentryPackage : sentryPackages) {
eventSdk.addPackage(sentryPackage.getName(), sentryPackage.getVersion());
}
}

List<String> integrations = sdk.getIntegrations();
Set<String> integrations = sdk.getIntegrationSet();
if (integrations != null) {
for (String integration : integrations) {
eventSdk.addIntegration(integration);
Expand Down
Loading