xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.52k stars 505 forks source link

[Bug] FilePicker doesn't work on Redmi phones with MIUI 12, Android 11, workaround available #2085

Open quomat opened 1 year ago

quomat commented 1 year ago

Description

Steps to Reproduce

  1. Lanuch EssentialsSample on a phone with MIUI 12 interface, like Redmi 8.
  2. Use the file picker, pick a file

Expected Behavior

The path to the file is shown

Actual Behavior

The operation appears cancelled

Basic Information

The issue is known around some places, please see this issue on Android Image Cropper app and this Stackoverflow question.

MIUI interface appears to ignore the result when using createChooser. I tested the repo locally and if I comment out this line: https://github.com/xamarin/Essentials/blob/35c56205769b1434838ad31ff9c65d5d0c3f50d5/Xamarin.Essentials/FilePicker/FilePicker.android.cs#L25 it works perfectly. Of course, this is not a solution, because users want to use their own apps for picking files - but on Xiaomi it's better than nothing.

How about putting the workaround for MIUI devices, for example using the method from here?

I can do the pull request, but will it be merged?

Thanks!

BDemetrix commented 6 months ago

A year has already passed, but the error has not been fixed!
This is very sad for such a popular package and a large number of Xiaomi devices!