fluttercandies / flutter_photo_manager

A Flutter plugin that provides images, videos, and audio abstraction management APIs without interface integration, available on Android, iOS, macOS and OpenHarmony.
https://pub.dev/packages/photo_manager
Apache License 2.0
667 stars 301 forks source link

When allowing select images and videos permission in Android 14, permission state is always denied. #1166

Open CrestNiraj12 opened 1 month ago

CrestNiraj12 commented 1 month ago

Version

3.2.2

Platforms

Android

Device Model

Emulators: Resizable (Experimental) API UpsideDownCake, Pixel XL

flutter info

[✓] Flutter (Channel stable, 3.19.6, on macOS 14.1.1 23B81 darwin-arm64, locale en-NP)
    • Flutter version 3.19.6 on channel stable at /Users/niraj.shrestha/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (3 months ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc4)
    • Android SDK at /Users/niraj.shrestha/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0-rc4
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.91.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.92.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 13 (API 33) (emulator)
    • sdk gphone64 arm64 (mobile) • emulator-5556 • android-arm64  • Android 13 (API 33) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 126.0.6478.183
    ! Error: Browsing on the local area network for Niraj’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this
      Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

• No issues found!

How to reproduce?

final ps = await PhotoManager.requestPermissionExtend(); // Allow select photos and videos
log('Permission State: $permissionState');
[Output] Permission State: PermissionState.denied
log('Has Access: ${permissionState.hasAccess}');
[Output] Has Access: false

Logs

No errors

Example code (optional)

No response

Contact

crestniraj@gmail.com

CaiJingLong commented 1 month ago

Have you added new permissions in AndroidManifest?

CrestNiraj12 commented 1 month ago

Have you added new permissions in AndroidManifest?

Yes.

    <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_VISUAL_USER_SELECTED"/>