Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
CrestNiraj12 opened this issue Jul 23, 2024 · 4 comments

Comments

@CrestNiraj12
Copy link

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

[email protected]

@CrestNiraj12 CrestNiraj12 changed the title When allowing selected images and videos permission in Android 14, permission state is always denied. When allowing select images and videos permission in Android 14, permission state is always denied. Jul 23, 2024
@CaiJingLong
Copy link
Member

Have you added new permissions in AndroidManifest?

@CrestNiraj12
Copy link
Author

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

@tmi-hieunv
Copy link

You must request Permission.photos.requestPermission()

@AlexV525
Copy link
Member

This is likely misconfigured with PermissionOptions during calls. Please verify and check other related issues that solved the relevant issue already.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants