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 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"