HBRecorder icon indicating copy to clipboard operation
HBRecorder copied to clipboard

the library is not working after tsrgeting android sdk 35

Open UmAr5997 opened this issue 3 months ago • 6 comments

READ THIS BEFORE OPENING AN ISSUE:

  • Fill in all the information below.
  • Have a look at previously asked questions to see if your issue has been resolved.
  • Properly format your issue.
  • All issues should be asked in English.
  • Delete all the above before posting your issue

Describe the bug A clear and concise description of what the bug is.

Log Please provide a well formatted bug report (by adding 4 spaces before the log)

Can it be reproduced in demo app Yes or no

HBRecorder version for example 1.0.1

Device information

  • Make/model
  • SDK version

Screenshots If applicable, add screenshots to help explain your problem.

UmAr5997 avatar Sep 26 '25 16:09 UmAr5997

Thank you for bringing this to my attention. Can you please elaborate what happens when you target SDK 35? Perhaps provide your stack trace. Thanks.

HBiSoft avatar Sep 30 '25 09:09 HBiSoft

Exception java.lang.RuntimeException: at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5770) at android.app.ActivityThread.-$$Nest$mhandleServiceArgs (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2728) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loopOnce (Looper.java:257) at android.os.Looper.loop (Looper.java:342) at android.app.ActivityThread.main (ActivityThread.java:9634) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:619) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:929) Caused by java.lang.SecurityException: at android.os.Parcel.createExceptionOrNull (Parcel.java:3257) at android.os.Parcel.createException (Parcel.java:3241) at android.os.Parcel.readException (Parcel.java:3224) at android.os.Parcel.readException (Parcel.java:3166) at android.app.IActivityManager$Stub$Proxy.setServiceForeground (IActivityManager.java:7410) at android.app.Service.startForeground (Service.java:863) at com.hbisoft.hbrecorder.ScreenRecordService.startFgs (ScreenRecordService.java:628) at com.hbisoft.hbrecorder.ScreenRecordService.onStartCommand (ScreenRecordService.java:247) at android.app.ActivityThread.handleServiceArgs (ActivityThread.java:5752) Caused by android.os.RemoteException: Remote stack trace: at com.android.server.am.ActiveServices.validateForegroundServiceType (qb/98113518 8c29678cd53c2f986da3424e127e8e4fc98dc8e44069cedbbd3c08d1b85164f0:126) at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked (qb/98113518 8c29678cd53c2f986da3424e127e8e4fc98dc8e44069cedbbd3c08d1b85164f0:1340) at com.android.server.am.ActiveServices.setServiceForegroundLocked (qb/98113518 8c29678cd53c2f986da3424e127e8e4fc98dc8e44069cedbbd3c08d1b85164f0:55) at com.android.server.am.ActivityManagerService.setServiceForeground (qb/98113518 8c29678cd53c2f986da3424e127e8e4fc98dc8e44069cedbbd3c08d1b85164f0:13) at android.app.IActivityManager$Stub.onTransact$setServiceForeground$ (IActivityManager.java:12521) here is the crash insight i keep getting from so many android 15 devices

UmAr5997 avatar Oct 01 '25 09:10 UmAr5997

Did you add the following in your manifest, as is said in the README:

<!-- For SDK 34 -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

You can also try adding:

<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />

Let me know after you tried the above.

HBiSoft avatar Oct 01 '25 10:10 HBiSoft

Hi @HBiSoft,

Thanks for the quick response earlier. I’ve added already both of the permissions you mentioned:

However, I’m still facing an issue on Android 15 (SDK 35) — when recording the entire device screen, the output video is completely blank (black) even though the recording service runs without crashing.

This happens consistently across multiple Android 15 devices (Pixel and Samsung).

Could you please check whether you’ve been able to reproduce this issue on SDK 35 or if you’ve already uploaded a working build of HBRecorder to the Play Store targeting API 35?

It seems related to the new foreground service restrictions or media projection handling in Android 15. Any update or patch would be greatly appreciated 🙏

UmAr5997 avatar Oct 07 '25 10:10 UmAr5997

The blank screen is because of the new Sharing restrictions mentioned in 196

jerinjohnk avatar Oct 14 '25 12:10 jerinjohnk

If you are talking about entire screen recording then I tested the app included in the repo on SDK 35 in Samsung 25 Ultra, Google Pixel 9 Pro and it worked fine. To Understand your problem better can you share a demo github repo of your environment or code so I can reproduce it. For Single App recoding, the blank screen behaviour is intended because that's a restriction from Android Side as mentioned by @jerinjohnk

AbdulWahab1539 avatar Oct 18 '25 17:10 AbdulWahab1539

This issue has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed if no further activity occurs within the next 3 days. Thank you for your contributions.

stale[bot] avatar Dec 18 '25 00:12 stale[bot]