Unable to compile for Android 13 (Android SDK v.33)[🐛]
Description
Unable to compile react-native-image-picker for Android SDK v.33 Tiramisu (Android 13).
How to repeat issue and example
- Create a React Native project
- Add
react-native-image-picker - Ensure Gradle JDK 11 and Android SDK 33 are installed on the machine that's gonna be used for the build
- Trigger app build with the following settings in
build.gradle:
compileSdkVersion = 33
targetSdkVersion = 33
Expected Results Successful app build
Actual Result The following compilation errors appear:
<project-path>/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/VideoMetadata.java:46: error: unreported exception IOException; must be caught or declared to be thrown
metadataRetriever.release();
^
Note: <project-path>/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/Utils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
Solution
Add exception handling for the IOException. Remove the usage of the deprecated API
Additional Information
- Image Picker version: 4.8.4
- React Native version: 0.66.1
- Platform: Android
- Development Operating System: MacOS
- Dev tools: Android Studio Chipmunk | 2021.2.1 Patch 1, Android SDK v.33 Tiramisu
I just saw that there's already an opened pull request for solving this issue. https://github.com/react-native-image-picker/react-native-image-picker/pull/2003
the same here
same here
same here, I use "react-native-image-picker": "^4.3.0"
Platform: Android Development Operating System: Window Dev tools: Android Studio Chipmunk | 2021.2.1 Patch 1, Android SDK v.33 Tiramisu
In OS13 Samsung device Show a dialog "read memory card access denied"... and can't open galley
Any update yet for this issue? i use "react-native": "0.64.2", "react-native-image-picker": "4.0.6", and compileSdkVersion = 33 targetSdkVersion = 33
Error Execution failed for task ':react-native-image-picker:compileDebugJavaWithJavac'.
You'd need to update react native to support Android 13. The following combination works for me.
"react-native": "0.71.3",
"react-native-image-picker": "5.2.0",
I solved it after adding try/catch to that particular line
Had the same problem after upgrading to Expo SDK 48, solved it by using react-native-image-picker ^5.3.1. Note: I did not manage to get it to work with react-native-image-picker 5.2.0
"react-native-create-thumbnail": "^2.0.0-rc.2",
You'd need to update react native to support Android 13. The following combination works for me.
"react-native": "0.71.3", "react-native-image-picker": "5.2.0",
Thankyou for helping Me It works for me .
I solved it after adding try/catch to that particular line
this worked for me