ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.22k stars 618 forks source link

Error when using Android SDK as a service with Samsung S23 Android 14 #5939

Open mustafaboleken opened 8 months ago

mustafaboleken commented 8 months ago

When we use Android SDK as a service, we are getting the following error on Samsung Galaxy S23 Android 14 device.

com.genymobile.scrcpy.wrappers.DisplayManager.java
Object displayInfo = manager.getClass().getMethod("getDisplayInfo", int.class).invoke(manager, displayId);

I have put some logs to check that manager object might be null and trying to access but no

Logs

12-08 06:17:07.946 21525 21525 I SystemCapture: Looping in main call 12-08 06:17:07.947 21525 21541 E AndroidRuntime: FATAL EXCEPTION: handler-thread 12-08 06:17:07.947 21525 21541 E AndroidRuntime: PID: 21525 12-08 06:17:07.947 21525 21541 E AndroidRuntime: java.lang.AssertionError: java.lang.reflect.InvocationTargetException 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:87) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at com.genymobile.scrcpy.Device.(Device.java:72) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at io.antmedia.webrtc_android_sample_app.SystemCapture.lambda$main$0(SystemCapture.java:138) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at io.antmedia.webrtc_android_sample_app.SystemCapture$$ExternalSyntheticLambda0.run(Unknown Source:4) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:958) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:230) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.os.Looper.loop(Looper.java:319) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at com.genymobile.scrcpy.wrappers.DisplayManager.getDisplayInfo(DisplayManager.java:72) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: ... 8 more 12-08 06:17:07.947 21525 21541 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.app.ConfigurationController.getConfiguration()' on a null object reference 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.app.ActivityThread.getConfiguration(ActivityThread.java:3899) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.hardware.display.DisplayManagerGlobal.getDisplayInfoLocked(DisplayManagerGlobal.java:260) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: at android.hardware.display.DisplayManagerGlobal.getDisplayInfo(DisplayManagerGlobal.java:234) 12-08 06:17:07.947 21525 21541 E AndroidRuntime: ... 10 more

mekya commented 4 months ago

hi @mustafaboleken,

I think Varun has resolved this issue and will send a PR to the master branch of Android SDK.

Cheers Oguz