DEV Community

Cover image for Removing Full-Screen Intent Permission from Flutter Android
junian
junian

Posted on Originally published at junian.dev on

Removing Full-Screen Intent Permission from Flutter Android

This article was originally published at Junian Dev Blog


Subscribe to Junian Dev YouTube Channel
Today I'm trying to submit a new version of the Flutter Android app to Google Play Store.
I didn't put any new features, just some bug fixes.
I didn't even change the dependencies.
Normally no issue whatsoever when I send it to the Google Play Store.

But, something unexpected happened.
I got an error message from the Play Store with the following message.

Your app uses the USE_FULL_SCREEN_INTENT permission. From May 31, 2024, some apps may no longer be eligible to have this permission pre-granted at install. Apps that aren't eligible or approved for this, must request permission from the user to launch an activity with full-screen intent. If the permission isn't granted and you don't check for this, your app will crash when full-screen intent is being used.

Well, this is unusual.

I didn't use that permission in my app.
So it's probably coming from one of my dependencies.

Luckily, it's an easy fix.

To fix this issue, we just need to add a few lines to the AndroidManifest.xml file.

You can find the manifest file at android/app/src/main/AndroidManifest.xml.
Here's what the content of my manifest file looks like before I fix the issue.

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application>
        <!-- ... -->
    </application>
</manifest>
Enter fullscreen mode Exit fullscreen mode

Now let's fix it by adding some configuration lines.

The first one is to add following snippet to manifest tag.

xmlns:tools="http://schemas.android.com/tools"
Enter fullscreen mode Exit fullscreen mode

Then you also need to add the following user permission removal under the manifest tag.

<uses-permission
    android:name="android.permission.USE_FULL_SCREEN_INTENT"
    tools:node="remove" />
Enter fullscreen mode Exit fullscreen mode

The final AndroidManifest.xml file will look something like the following snippet.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission
        android:name="android.permission.USE_FULL_SCREEN_INTENT"
        tools:node="remove" />

    <application>
        <!-- ... -->
    </application>
</manifest>
Enter fullscreen mode Exit fullscreen mode

Once you make the changes, update your app version, and republish to Google Play Store.
This time it won't have any issue!

Thanks for reading and have a good day!

Top comments (0)