Open rahulserver opened 3 years ago
I also encountered this problem on many different devices. OPPO, Samsung (S22), Realme
but on ios, it works fine.
@rahulserver @ammykam The following method will return null if the file exists but isn't able to be decoded into a bitmap, perhaps not an image or an unexpected encoding. So in the java code adding a null check and returning an error is probably the best way to handle it. i.e.
Bitmap bmp = BitmapFactory.decodeFile(fileName);
if (bmp == null) {
result.error("File could not be decoded by BitmapFactory", fileName, null);
return;
}
Here is my code:
This gives below error on miui (Works fine on samsung or android emulator)