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

Test - [Bug report] setIgnorePermissionCheck in Android does not return a result #9

Closed
AmosHuKe opened this issue Nov 1, 2024 · 1 comment

Comments

@AmosHuKe
Copy link
Member

AmosHuKe commented Nov 1, 2024

Version

2.8.0

Platforms

Android

Device Model

OnePlus 5T (Android 8.1.0), OnePlus 8 Pro (Android 13)

flutter info

[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.19045.3570], locale ru-UA)
    • Flutter version 3.13.9 on channel stable at xxxxxx
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d211f42860 (2 weeks ago), 2023-10-25 13:42:25 -0700
    • Engine revision 0545f8705d
    • Dart version 3.1.5
    • DevTools version 2.25.0

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

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at xxxxxx

[√] Chrome - develop for the web
    • Chrome at xxxxxx

[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.6.2)
    • Visual Studio at xxxxxx
    • Visual Studio Build Tools 2022 version 17.6.33723.286
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.1)
    • Android Studio at xxxxxx
    • 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)

[√] Connected device (4 available)
    • Windows (desktop) • windows  • windows-x64    • Microsoft Windows [Version 10.0.19045.3570]
    • Chrome (web)      • chrome   • web-javascript • Google Chrome 119.0.6045.123
    • Edge (web)        • edge     • web-javascript • Microsoft Edge 119.0.2151.44

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

! Doctor found issues in 1 category.

How to reproduce?

Just call method
await PhotoManager.setIgnorePermissionCheck(true);

After calling this function, it does not return a result. That is, the code that comes after this line is not executed until it returns the result.
And this is very strange behavior.
If we wrap this line in try catch, then we do not catch any errors. It looks like the problem is that the native part doesn't return anything.
I tested this on different versions of Android and the behavior remained the same.

At the same time, Android works fine on version 2.7.2, but the same problem will occur on iOS.
In version 2.8.0, iOS works fine, but Android no longer works.

Logs

No response

Example code (optional)

print('Code before setIgnorePermissionCheck');
    try{
      await PhotoManager.setIgnorePermissionCheck(value);
    }
    catch(e){
      print(e);
    }
    print('Code after setIgnorePermissionCheck');
@AmosHuKe
Copy link
Member Author

AmosHuKe commented Nov 1, 2024

AI Summary: 在 Android 上,PhotoManager.setIgnorePermissionCheck 方法在版本 2.8.0 中无法返回结果,导致后续代码无法执行。该问题在 Android 8.1.0 和 Android 13 上都存在,但在 2.7.2 版本中正常工作。iOS 在 2.8.0 版本中正常工作,但在 2.7.2 版本中存在相同问题。

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

1 participant