Old flutter Version not giving storage permission and updating is not an option

53 views Asked by At

They gave a small project for revision and the problem is as follows: The application has an image selection function. Before Android 13, everything works fine, but on version 13, no library gives access. This is most likely due to the fact that the project uses Flutter 1.22.0. with version Dart 2.10 (before null safety). I have already added to the manifest the necessary permissions:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="32"/>
<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.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>

But apparently due to the fact that the libraries are old, he does not see that accesses are allowed (I turn them on manually on the phone). An example, MultiImagePicker.pickImages was originally used, which threw an exception Permission denied. Next, I tried the image_picker package, there, when calling the method, it gives the following stack:

E/flutter (12634): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: PlatformException(photo_access_denied, The user did not allow photo access., null, null)

Accordingly, I have a question, so switching to a later version of flutter is a rather time-consuming task, is it possible to somehow do without it? Maybe someone already had experience? I'm sure that the point is that the old versions of these libraries are not yet designed to work with Android 13

Thank you!

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    android:maxSdkVersion="32"/>
<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.READ_MEDIA_IMAGES"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>
1

There are 1 answers

1
Midlaj Nazar On

In Android 13 u dont need to use all those permission, please remove it and try again