From 270c4232b88c35cadcf6df67f4d9c89e2379cd48 Mon Sep 17 00:00:00 2001 From: Liam Jones Date: Wed, 23 Jul 2025 13:07:01 +0100 Subject: [PATCH 1/2] Fix for sentry-cli path discovery not working The previous code was trying to pass a `Process` to `new File()` (instead of a String) and there's no File constructor that takes a Process so it'd immediately end up in the catch block --- packages/core/sentry.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/sentry.gradle b/packages/core/sentry.gradle index d979b6d186..a11837ce84 100644 --- a/packages/core/sentry.gradle +++ b/packages/core/sentry.gradle @@ -305,8 +305,7 @@ def resolveSentryReactNativeSDKPath(reactRoot) { def resolveSentryCliPackagePath(reactRoot) { def resolvedCliPath = null try { - def file = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir)) - resolvedCliPath = file.text.trim().getParentFile(); + resolvedCliPath = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir).text.trim()).getParentFile(); } catch (Throwable ignored) { // Check if it's located in .pnpm try { def pnpmRefPath = reactRoot.toString() + "/node_modules/@sentry/react-native/node_modules/.bin/sentry-cli" From fdec66ee81fe11363e4749abca52172f5119862c Mon Sep 17 00:00:00 2001 From: Liam Jones Date: Wed, 23 Jul 2025 15:11:29 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8050a69835..0a3f2d16fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Fixes - Fixed Sentry CLI executable path resolution that was causing iOS build script failures ([#5003](https://github.com/getsentry/sentry-react-native/pull/5003)) +- Fix for `sentry-cli` path discovery not working on Android ([#5009](https://github.com/getsentry/sentry-react-native/pull/5009)) ### Features