Baseflow / flutter-permission-handler

Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.
https://baseflow.com
MIT License
2.02k stars 838 forks source link

[Bug]: request() does not return a status on android with targetSdkVersion 34 and flutter 3.24.0 #1357

Closed joelbrostrom closed 1 week ago

joelbrostrom commented 1 month ago

Please check the following before submitting a new issue.

Please select affected platform(s)

Steps to reproduce

  1. set targetSdkVersion to 34
  2. call final newStatus = await Permission.locationWhenInUse.request();
  3. Give permission in the dialog

The method never returns.

Expected results

await Permission.locationWhenInUse.request() should return a new status after the permission is given.

Actual results

The method never returns.

Code sample

Code sample ```dart final status = await Permission.locationWhenInUse.status; if (status.isDenied) { final newStatus = await Permission.locationWhenInUse.request(); if (newStatus.isDenied) { // User can continue using map without user location return; } if (newStatus.isGranted) { await onPermissionGranted(); } } ```

Version

11.3.1

Flutter Doctor output

Doctor output ```console Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-SE) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.92.0) [✓] Connected device (4 available) [✓] Network resources • No issues found! ```
TimHoogstrate commented 3 weeks ago

Dear @joelbrostrom,

I cannot reproduce this issue. Android 34 device targetSDK 34. Flutter 3.24.0. Can you try the example app? Or check if some other permission_handler_android version is used in your case.

  permission_handler:
    dependency: "direct dev"
    description:
      name: permission_handler
      sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
      url: "https://pub.dev"
    source: hosted
    version: "11.3.1"
  permission_handler_android:
    dependency: "direct dev"
    description:
      name: permission_handler_android
      sha256: "76e4ab092c1b240d31177bb64d2b0bea43f43d0e23541ec866151b9f7b2490fa"
      url: "https://pub.dev"
    source: hosted
    version: "12.0.12"
  permission_handler_apple:
    dependency: transitive
    description:
      name: permission_handler_apple
      sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0
      url: "https://pub.dev"
    source: hosted
    version: "9.4.5"
  permission_handler_html:
    dependency: transitive
    description:
      name: permission_handler_html
      sha256: "6cac773d389e045a8d4f85418d07ad58ef9e42a56e063629ce14c4c26344de24"
      url: "https://pub.dev"
    source: hosted
    version: "0.1.2"
  permission_handler_platform_interface:
    dependency: transitive
    description:
      name: permission_handler_platform_interface
      sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20"
      url: "https://pub.dev"
    source: hosted
    version: "4.2.1"
  permission_handler_windows:
    dependency: transitive
    description:
      name: permission_handler_windows
      sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
      url: "https://pub.dev"
    source: hosted
    version: "0.2.1"
  plugin_platform_interface:
    dependency: transitive
    description:
      name: plugin_platform_interface
      sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
      url: "https://pub.dev"
    source: hosted
    version: "2.1.8"
github-actions[bot] commented 1 week ago

Without additional information, we are unfortunately not able to resolve this issue. Therefore, we reluctantly closed this issue for now. If you run into this issue later, feel free to file a new issue with a reference to this issue. Add a description of detailed steps to reproduce, expected and current behaviour, logs and the output of 'flutter doctor -v'. Thanks for your contribution.