-
Notifications
You must be signed in to change notification settings - Fork 63
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
Can't create a tracker with an Application context #657
Comments
Hi @eygraber, thanks for reporting this! We have seen this before in relation to using the tracker through dependency injection with Hilt. Do you by any chance also use Hilt? The error seems to come from the way that the screen resolution is fetched in Subject. We will change this in the upcoming version 6 of the tracker to match how we retrieve the resolution here. |
I use a different DI, and I'm explicitly using the Application context. I believe this behavior was introduced in Android 11 where trying to get a visual service (like WindowManager) from an application context isn't allowed. |
Hey, I am using Snowplow dependency with version 6.0.2 and I am still encountering the same or similar issue. I am using Google Pixel with Android 14 if that's of any help. Here's the stacktrace:
|
Thanks for the report. That's disappointing. We'll have a look |
Describe the bug
When calling
Snowplow.createTracker
with aContext
retrieved fromApplication.applicationContext
, sending an event logs an error, and no events are sent:To Reproduce
Expected behavior
Not to get this error.
Device informatoin (please complete the following information):
Additional context
I tried downgrading to v5.0.0 and the issue is still present there. I also tried on Android versions down to API 30
The text was updated successfully, but these errors were encountered: