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

Android - DSN is required. crash on launch when a valid DSN is specified #3755

Open
bricefriha opened this issue Nov 13, 2024 · 6 comments
Open
Assignees
Labels
Bug Something isn't working Native Platform: Android

Comments

@bricefriha
Copy link
Collaborator

bricefriha commented Nov 13, 2024

Package

Sentry

.NET Flavor

.NET

.NET Version

8

OS

Android

SDK Version

4.13.0

Steps to Reproduce

  1. Create an Android project (not MAUI)
  2. Add the DSN in the options:
    options.Dsn = "..."; // Enter a valid DSN
    options.Debug = true;

Alternatively, from the sentry-dotnet just run the sample app Sentry.Samples.Android

Note

Make sure the SDK version is 4.13.0. versions below work just fine

Expected Result

The app should launch without a crash

Actual Result

Crashes on launch, telling us the DSN is missing

Image

@bricefriha bricefriha changed the title Android Native - DSN is required. crash on launch when a valid DSN is specified Android - DSN is required. crash on launch when a valid DSN is specified Nov 13, 2024
@bricefriha bricefriha added Bug Something isn't working Platform: Android Native labels Nov 13, 2024
@bricefriha
Copy link
Collaborator Author

To confirm, This affects all versions of the dotnet SDK above 4.12.2

@jamescrosswell
Copy link
Collaborator

To confirm, This affects all versions of the dotnet SDK above 4.12.2

Yikes, it looks like samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj is filtered out of the Sentry-CI-Build-macOS.slnf as well, so this isn't' being detected in CI (which it should be).

@bricefriha
Copy link
Collaborator Author

samples/Sentry.Samples.Android/Sentry.Samples.Android.csproj is filtered out of the Sentry-CI-Build-macOS.slnf as well, so this isn't' being detected in CI (which it should be).

Sheesh!...
Is it something we can fix separately?

@bricefriha
Copy link
Collaborator Author

bricefriha commented Nov 14, 2024

It seems like the issue is specifically related to the Android replay package => sentry-android-replay-7.16.0.aar

I tested with all the versions of sentry-android-replay from 7.12.0 to 7.17.0. Same problem occur everytime

@bricefriha bricefriha self-assigned this Nov 18, 2024
@bricefriha
Copy link
Collaborator Author

bricefriha commented Nov 19, 2024

Update on this

It seems like the configuration callback is never invoked via void OptionsConfigurationCallback.Configure(JavaObject optionsObject).

I investigated, and here's what I observed:

  • On MAUI Android: OptionsConfigurationCallback.Configure(JavaObject optionsObject) is invoked as soon as SentryAndroid.Init(); is called
  • On vanilla Android with the 4.12.2 SDK, the configuration callback is called from the code Android bindings generate.
__this.Configure (p0!);

Line 93 of Sentry.Java.Sentry.cs

  • On vanilla Android with 4.13 SDK: the app crashes before the configuration method is even called

For the later two, OptionsConfigurationCallback.Configure(JavaObject optionsObject) is basically never called

It seems like this has something has to be fixed on Sentry.Android.Bindings, but the thing is that the 3 cases I mentioned all share the same code...

@jamescrosswell
Copy link
Collaborator

@romtsn do you have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Native Platform: Android
Projects
Status: No status
Development

No branches or pull requests

2 participants