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

Android 14 Permission related crash #212

Closed
bhavinb98 opened this issue Mar 15, 2024 · 7 comments
Closed

Android 14 Permission related crash #212

bhavinb98 opened this issue Mar 15, 2024 · 7 comments

Comments

@bhavinb98
Copy link

bhavinb98 commented Mar 15, 2024

I already have the following permissions declared in my manifest but it still throws an error and crashes.
Flutter version - 3.19.3
Plugin Version - 6.1.3

<uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" />
<uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />
<service
    android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
    android:foregroundServiceType="mediaPlayback|camera|microphone|mediaProjection"
    android:stopWithTask="true"/>
java.lang.RuntimeException: Unable to create service com.pravera.flutter_foreground_task.service.ForegroundService: java.lang.SecurityException: Starting FGS with type mediaProjection callerApp=ProcessRecord{73ae391 7353:com.sprintstudio.conversations/u0a190} targetSDK=34 requires permissions: all of the permissions allOf=true [android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION] any of the permissions allOf=false [android.permission.CAPTURE_VIDEO_OUTPUT, android:project_media]
@GaelleJoubert
Copy link
Contributor

I am using other permissions, but they need to be not only in the manifest, but explicitly asked to the user (with permission_handler pluggin for exemple).
Maybe this is the same for you ? Have you tried to ask them to the user ?

@bhavinb98
Copy link
Author

Yes, I am asking the relevant permissions.

I'm also asking for these permissions which are required for foreground task to work

await FlutterForegroundTask.requestIgnoreBatteryOptimization();
await FlutterForegroundTask.requestNotificationPermission();

@ishabodiwala
Copy link

Hey @bhavinb98, i am getting the same issue. Are you able to solve the issue ?

@bhavinb98
Copy link
Author

@ishabodiwala no, not yet

@UnluckyY1
Copy link
Contributor

this may help

@bhavinb98
Copy link
Author

Have tried it already. It's not working.

@bhavinb98
Copy link
Author

@ishabodiwala Possible solution for your issue

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

4 participants