You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Android 11 or above devices, StrictMode is raising an IllegalAccessException due to the new restrictions of non-visual Context usages when handling UI.
This is happening when calling BarcodeView#resume() and it is caused due to usage of application content to get the WindowManager in RotationListener#listen() method.
Which library version are you using? 4.1.0
Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0) Pixel 2, Android 12
Does the same happen on other devices or an emulator? It happens on all Android 11 or above devices
In the case of an error do you have a stack trace or adb logs?
2022-01-10 16:31:54.646 15047-15047/------ E/ContextImpl: Tried to access visual service WindowManager from a non-visual Context:--------@1350853 WindowManager should be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.
java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:-----Application@1350853
at android.app.ContextImpl.getSystemService(ContextImpl.java:2059)
at android.content.ContextWrapper.getSystemService(ContextWrapper.java:857)
at com.journeyapps.barcodescanner.RotationListener.listen(RotationListener.java:36)
at com.journeyapps.barcodescanner.CameraPreview.resume(CameraPreview.java:633)
The text was updated successfully, but these errors were encountered:
Description of the problem:
In Android 11 or above devices, StrictMode is raising an IllegalAccessException due to the new restrictions of non-visual Context usages when handling UI.
This is happening when calling BarcodeView#resume() and it is caused due to usage of application content to get the WindowManager in RotationListener#listen() method.
Which library version are you using? 4.1.0
Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0) Pixel 2, Android 12
Does the same happen on other devices or an emulator? It happens on all Android 11 or above devices
In the case of an error do you have a stack trace or adb logs?
2022-01-10 16:31:54.646 15047-15047/------ E/ContextImpl: Tried to access visual service WindowManager from a non-visual Context:--------@1350853 WindowManager should be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.
java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:-----Application@1350853
at android.app.ContextImpl.getSystemService(ContextImpl.java:2059)
at android.content.ContextWrapper.getSystemService(ContextWrapper.java:857)
at com.journeyapps.barcodescanner.RotationListener.listen(RotationListener.java:36)
at com.journeyapps.barcodescanner.CameraPreview.resume(CameraPreview.java:633)
The text was updated successfully, but these errors were encountered: