Open zhangliukun opened 2 years ago
If we don't add the android:requestLegacyExternalStorage="true" in the AndroidManifest.xml , the app will crash if we choose image from our phone or take a photo from the camera.
Caution: After you update your app to target Android 11 (API level 30), [the system ignores the requestLegacyExternalStorage attribute](https://developer.android.com/about/versions/11/privacy/storage#scoped-storage) when your app is running on Android 11 devices, so your app must be ready to support scoped storage and to [migrate app data](https://developer.android.com/training/data-storage/use-cases#migrate-legacy-storage) for users on those devices.
bug1: The onActivityResult method in MainActivity will lead to the image from local file or the camera rotate 90 in my huawei p40. I fix it by delete the code matrix.postRotate(90.0f);
bug2: You should add another permission in the AndroidManifest.xml so that the app won't be crash. Add android:requestLegacyExternalStorage="true" in the AndroidManifest.xml .