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

The issue with targetSDK 14 #230

Open
Alex10000001 opened this issue Mar 26, 2024 · 6 comments
Open

The issue with targetSDK 14 #230

Alex10000001 opened this issue Mar 26, 2024 · 6 comments

Comments

@Alex10000001
Copy link

Alex10000001 commented Mar 26, 2024

Issue: java.lang.IllegalAccessException accessing visual service WindowManager from a non-visual Context

Description:

When attempting to access the visual service WindowManager from a non-visual Context, specifically in the CameraSession and Camera2Session classes, an IllegalAccessException is thrown. This occurs within the org.webrtc package and seems to be related to device orientation retrieval.

Error Trace:

java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:com.my.app.Application@4187070
    at android.app.ContextImpl.getSystemService(ContextImpl.java:2278)
    at android.content.ContextWrapper.getSystemService(ContextWrapper.java:951)
    at com.facebook.react.bridge.ReactContext.getSystemService(ReactContext.java:165)
    at org.webrtc.CameraSession.getDeviceOrientation(CameraSession.java:43)
    at org.webrtc.Camera2Session.getFrameOrientation(Camera2Session.java:414)
    at org.webrtc.Camera2Session.-$$Nest$mgetFrameOrientation(Unknown Source:0)
    at org.webrtc.Camera2Session$CaptureSessionCallback.lambda$onConfigured$0$org-webrtc-Camera2Session$CaptureSessionCallback(Camera2Session.java:204)
    at org.webrtc.Camera2Session$CaptureSessionCallback$$ExternalSyntheticLambda0.onFrame(Unknown Source:2)
    at org.webrtc.SurfaceTextureHelper.tryDeliverTextureFrame(SurfaceTextureHelper.java:370)
    at org.webrtc.SurfaceTextureHelper.lambda$new$0$org-webrtc-SurfaceTextureHelper(SurfaceTextureHelper.java:207)
    at org.webrtc.SurfaceTextureHelper$$ExternalSyntheticLambda0.onFrameAvailable(Unknown Source:2)
    at android.graphics.SurfaceTexture$1.handleMessage(SurfaceTexture.java:214)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:230)
    at android.os.Looper.loop(Looper.java:319)
    at android.os.HandlerThread.run(HandlerThread.java:67)

Steps to Reproduce:

  1. Attempt to access visual service WindowManager from a non-visual Context.
  2. Use classes CameraSession and Camera2Session within the org.webrtc package.
  3. Trigger any action related to device orientation retrieval.

Expected Behavior:

The application should be able to access the WindowManager service without encountering an IllegalAccessException when called from a non-visual Context.

Actual Behavior:

An IllegalAccessException is thrown, indicating an attempt to access WindowManager from a non-visual Context.

Environment:

  • Android Platform
  • Application: com.my.app.Application@4187070
  • Related Libraries: com.facebook.react.bridge, org.webrtc

Possible Solutions:

  • Ensure proper context handling when accessing visual services.
  • Review the usage of Context within the affected classes to determine why it's being used in a non-visual context.

This issue needs to be addressed to ensure proper functionality and prevent runtime exceptions.

I passed activity context.

gradle:
implementation("org.jitsi.react:jitsi-meet-sdk:9.0.0") { transitive = true }

@saghul
Copy link
Member

saghul commented Mar 26, 2024

Are you reproducing this with the sample app?

@Alex10000001
Copy link
Author

Are you reproducing this with the sample app?

No

@saghul
Copy link
Member

saghul commented Mar 27, 2024

Then unless you share some small sample code that reproduce the problem it's very hard for us to help you.

@Alex10000001
Copy link
Author

Let me know what details I have to provide for helping me?

@Alex10000001
Copy link
Author

Btw the app works fine with the version of the library: org.jitsi.react:jitsi-meet-sdk:5.1.0

@saghul
Copy link
Member

saghul commented Mar 27, 2024

We need a way to reproduce the problem.

That SDK is years old, so it's no longer relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants