E/AndroidRuntime: FATAL EXCEPTION: screen_setup_thread Process: com.codestomp.agora_flutter_app:screensharingsvc, PID: 27844 java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION at android.os.Parcel.createExceptionOrNull(Parcel.java:2373) at android.os.Parcel.createException(Parcel.java:2357) at android.os.Parcel.readException(Parcel.java:2340) at android.os.Parcel.readException(Parcel.java:2282) at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231) at android.media.projection.MediaProjection.<init>(MediaProjection.java:59) at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:119) at io.agora.rtc.ss.impl.ScreenCapture.initProjection(ScreenCapture.java:246) at io.agora.rtc.ss.impl.ScreenCapture$3.handleMessage(ScreenCapture.java:393) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:479) at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135) at android.os.Binder.execTransactInternal(Binder.java:1154) at android.os.Binder.execTransact(Binder.java:1123)
which demo app you are running?
the process id seems to be
com.codestomp.agora_flutter_app:screensharingsvc
is that based agora flutter sdk or something?
E/AndroidRuntime: FATAL EXCEPTION: screen_setup_thread Process: com.codestomp.agora_flutter_app:screensharingsvc, PID: 27844 java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION at android.os.Parcel.createExceptionOrNull(Parcel.java:2373) at android.os.Parcel.createException(Parcel.java:2357) at android.os.Parcel.readException(Parcel.java:2340) at android.os.Parcel.readException(Parcel.java:2282) at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231) at android.media.projection.MediaProjection.<init>(MediaProjection.java:59) at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:119) at io.agora.rtc.ss.impl.ScreenCapture.initProjection(ScreenCapture.java:246) at io.agora.rtc.ss.impl.ScreenCapture$3.handleMessage(ScreenCapture.java:393) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.os.RemoteException: Remote stack trace: at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:479) at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135) at android.os.Binder.execTransactInternal(Binder.java:1154) at android.os.Binder.execTransact(Binder.java:1123)