I have an exception that happens only on Huawei devices in my app when using FileProvider.getUriForFile:
Exception: java.lang.Illeg
My solution to this issue right now, even if it's not perfect, is to declare my FileProvider with the following path (to be able serve all files on the device):
This is not officially documented and might break with a future version of the v4 Support library but I can't see any other solution to serve a file in the secondary external storage (often the SD card) using the existing FileProvider.