react-native-image-picker icon indicating copy to clipboard operation
react-native-image-picker copied to clipboard

Unable to compile for Android 13 (Android SDK v.33)[🐛]

Open kakato10 opened this issue 3 years ago • 13 comments

Description

Unable to compile react-native-image-picker for Android SDK v.33 Tiramisu (Android 13).

How to repeat issue and example

  1. Create a React Native project
  2. Add react-native-image-picker
  3. Ensure Gradle JDK 11 and Android SDK 33 are installed on the machine that's gonna be used for the build
  4. 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

kakato10 avatar Aug 05 '22 09:08 kakato10

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

kakato10 avatar Aug 08 '22 08:08 kakato10

the same here

mary-ng5519 avatar Aug 11 '22 22:08 mary-ng5519

same here

AteqEjaz avatar Sep 05 '22 16:09 AteqEjaz

same here, I use "react-native-image-picker": "^4.3.0"

imamrobani avatar Dec 22 '22 13:12 imamrobani

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

mspl-java avatar Dec 27 '22 06:12 mspl-java

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'.

MursiDirect avatar Mar 06 '23 19:03 MursiDirect

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",

Johan-dutoit avatar Mar 13 '23 14:03 Johan-dutoit

I solved it after adding try/catch to that particular line

HItanshuGajjar avatar Apr 06 '23 05:04 HItanshuGajjar

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

kennethlynne avatar Apr 14 '23 13:04 kennethlynne

"react-native-create-thumbnail": "^2.0.0-rc.2",

TheScalion avatar Jun 05 '23 06:06 TheScalion

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 .

hashteam2013 avatar Jun 23 '23 09:06 hashteam2013

I solved it after adding try/catch to that particular line

this worked for me

sushilbansal avatar Aug 30 '23 13:08 sushilbansal

I solved it after adding try/catch to that particular line

This is solved in version 4.9.0

ItaloFalzoni avatar Dec 06 '23 20:12 ItaloFalzoni