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

Fix issue leaked IntentReceiver for SystemEventBreadcrumbsIntegration #3658

Closed
mayananand369 opened this issue Aug 26, 2024 · 4 comments
Closed
Labels
Platform: Android Type: Bug Something isn't working

Comments

@mayananand369
Copy link

Integration

sentry-android

Build System

Gradle

AGP Version

8.2.2

Proguard

Disabled

Version

7.8.0

Steps to Reproduce

When i run the app with the following configurations(as shown in the image attached), it shows the Leaked Intent receiver error for io.sentry.android.core.SystemEventsBreadcrumbsIntegrations$SystemEventsBroadcastReceiver

Following is my SentryLogger class:
Image

Following is the entry point of my app CheckInternetAndSessionActivity where i have configured sentry:
Image

Expected Result

There should not be any error regarding this.

Actual Result

Image

Image

@markushi
Copy link
Member

@mayananand369 thanks for reporting! This indeed looks like a bug on our end.

In the meantime you can init the Sentry SDK by using the application context, like this:

SentryAndroid.init(context.getApplicationContext(), ...

@markushi markushi moved this from Needs Discussion to Todo in Mobile & Cross Platform SDK Aug 28, 2024
@mayananand369
Copy link
Author

@markushi i have already init the Sentry SDK like this. Thanks

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Aug 28, 2024
@markushi
Copy link
Member

@mayananand369 are you sure? As far as I can see from your screenshots your fun configureSentryEnvironment() passes this as a context parameter, which is an Activity Context - hence the leak.

@mayananand369
Copy link
Author

@markushi okay. I got your point. Thanks for pointing this out. I passed applicationContext in place of this and it worked. You may close this issue now.

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

No branches or pull requests

2 participants