Skip to content

Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION #77

@Tech4Life-salman

Description

@Tech4Life-salman

On Android 10 application is crash after giving permission of Screen Capture with following error
Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
error is on this line
this.mMediaProjection = mProjectionManager.getMediaProjection(this.result, this.data);
Although I added foreground permission in manifest and in-service tag to

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions