Skip to content

fix: crashpad path not being found #3016

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- String templating for structured logs #3002 ([#3002](https://github.com/getsentry/sentry-dart/pull/3002))
### Features

### Fixes

- Add additional crashpad path candidate ([#3016](https://github.com/getsentry/sentry-dart/pull/3016))

## 9.1.0

### Features
Expand Down
6 changes: 5 additions & 1 deletion flutter/lib/src/native/c/sentry_native.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class SentryNative with SentryNativeSafeInvoker implements SentryNativeBinding {

if (crashpadPath != null) {
native.options_set_handler_path(cOptions, c.str(crashpadPath));
} else {
options.log(
SentryLevel.warning, 'SentryNative: could not find crashpad path');
}

return cOptions;
Expand Down Expand Up @@ -440,7 +443,8 @@ String? _getDefaultCrashpadPath() {
final appDir = Platform.resolvedExecutable.substring(0, lastSeparator);
final candidates = [
'$appDir${Platform.pathSeparator}crashpad_handler',
'$appDir${Platform.pathSeparator}bin/crashpad_handler'
'$appDir${Platform.pathSeparator}bin/crashpad_handler',
'$appDir${Platform.pathSeparator}lib/crashpad_handler'
Comment on lines +446 to +447

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pedantic, but ${Platform.pathSeparator} is used between appDir and candidate directories, but not between bin or lib and crashpad_handler

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, will update it

];
return candidates.firstWhereOrNull((path) => File(path).existsSync());
}
Expand Down
Loading