Skip to content

Commit ff0e5d8

Browse files
authored
Fix for sentry-cli path discovery not working on Android (#5009)
* 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 * Add changelog entry
1 parent 03e22d9 commit ff0e5d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
### Fixes
1212

1313
- Fixed Sentry CLI executable path resolution that was causing iOS build script failures ([#5003](https://github.com/getsentry/sentry-react-native/pull/5003))
14+
- Fix for `sentry-cli` path discovery not working on Android ([#5009](https://github.com/getsentry/sentry-react-native/pull/5009))
1415

1516
### Features
1617

packages/core/sentry.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,7 @@ def resolveSentryReactNativeSDKPath(reactRoot) {
305305
def resolveSentryCliPackagePath(reactRoot) {
306306
def resolvedCliPath = null
307307
try {
308-
def file = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir))
309-
resolvedCliPath = file.text.trim().getParentFile();
308+
resolvedCliPath = new File(["node", "--print", "require.resolve('@sentry/cli/package.json')"].execute(null, rootDir).text.trim()).getParentFile();
310309
} catch (Throwable ignored) { // Check if it's located in .pnpm
311310
try {
312311
def pnpmRefPath = reactRoot.toString() + "/node_modules/@sentry/react-native/node_modules/.bin/sentry-cli"

0 commit comments

Comments
 (0)