Skip to content

[camera] camera plugin declares READ_EXTERNAL_STORAGE permission by default #131116

@andynewman10

Description

@andynewman10

Is there an existing issue for this?

Steps to reproduce

  1. Create a new Flutter project. I use Flutter 3.10.5 and VS Code ('Flutter: New Project' then 'Application' template)
  2. Add camera: ^0.10.5+2 and camera_android_camerax: ^0.5.0+11in the dependencies section of pubspec.yaml
  3. Build the project right away with flutter build appbundle
  4. Examine the AndroidManifest.xml file in the generated app bundle (.aab file)

The manifest has the following declarations:

    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-feature android:name="android.hardware.camera.any"/>
    <uses-permission android:maxSdkVersion="28" android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

The WRITE_EXTERNAL_STORAGE storage permission makes sense, as the camera plugin allows to save image data to storage.

I miss what the READ_EXTERNAL_STORAGE permission is supposed to do. This permission looks scary when an application is published to the Play Store, as the Play Store indicates in this case that the application may read files on the device... Many users are cautious about this.

Many developers making use of the camera plugin do not make active use of neither WRITE_EXTERNAL_STORAGE nor READ_EXTERNAL_STORAGE. Many Flutter plugins using the camera don't use/declare either WRITE or READ storage permissions (eg. flutter barcode scanner, for instance).

I know that the permissions may be removed with tools:node="remove", but the camera plugin documentation should develop why these permissions are needed.

Expected results

camera plugin documentation explaining why the permissions are needed and, if possible, how to remove them if the functionality provided by the permissions are not actually used by the developer.

Actual results

The documentation does not say anything about these permissions.

Code sample

Code sample
camera: ^0.10.5+2

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [version 10.0.22000.2176], locale fr-FR)
    • Flutter version 3.10.5 on channel stable at C:\Users\andy\Documents\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (5 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\andy\AppData\Local\Android\sdk
    • Platform android-33, build-tools 34.0.0
    • Java binary at: C:\Users\andy\Documents\Applications\android-studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.0.2)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.0.31919.166
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Users\andy\Documents\Applications\android-studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-9505619)

[√] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at C:\Users\andy\Documents\Applications\IntelliJ
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart

[√] VS Code (version 1.80.1)
    • VS Code at C:\Users\andy\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.68.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [version 10.0.22000.2176]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 114.0.5735.199
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 114.0.1823.82

[√] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listp: cameraThe camera pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions