Home > Software design >  Storage permission dined in Android Flutter
Storage permission dined in Android Flutter

Time:01-03

My app have a problem with STORAGE permission in Android version: 13, it returns false always and don't show allow permission popup when I use the following line:

await Permission.storage.request().isGranted

I use:

permission_handler: ^10.2.0

Flutter version: 3.3.10

My permissions in AndroidManifest.xml are here:

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />
   
    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>
        <intent>
            <action android:name="android.intent.action.DIAL" />
            <data android:scheme="tel" />
        </intent>
        <intent>
            <action android:name="android.intent.action.SEND" />
            <data android:mimeType="*/*" />
        </intent>
    </queries>

CodePudding user response:

Change the android:maxSdkVersion to 33

https://apilevels.com/

CodePudding user response:

You should not request READ and or WRITE external storage permission on an Android 13 device.

Only the READ_MEDIA_XXXC permissions.

  • Related