-
Notifications
You must be signed in to change notification settings - Fork 163
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
Crash with targetSdkVersion 31 due to accessing WindowManager from ApplicationContext #323
Comments
This line doesn't exist The question is valid, if we set minSDk to 19 and loose 0,41 % ? @d4rken |
The error is from here, not sure why the line numbers are off. matomo-sdk-android/tracker/src/main/java/org/matomo/sdk/tools/DeviceHelper.java Lines 78 to 85 in 7216a32
The SDK inits on the app context, so we get the I wouldn't be opposed to raising the minApi (do we do a major version bump for this?), but I don't think it would solve this. Even with the legacy code removed )#335) we need the DisplayMetrics displayMetrics = new DisplayMetrics();
display.getRealMetrics(displayMetrics);
width = displayMetrics.widthPixels;
height = displayMetrics.heightPixels; Otherwise we'd have to get one from the dev (
Is there a way to do it correctly without a UI context? 🤔 |
The text was updated successfully, but these errors were encountered: