From a0abf74c2e5d10057c93725c70c252ffc56d4f33 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Thu, 1 Sep 2022 10:05:25 +0200 Subject: [PATCH] fix(android): compile error when compileSdkVersion is set to 33 (#419) --- android/gradle.properties | 2 +- .../cameraroll/CameraRollModule.java | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index f51720d..f23627b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -ReactNativeCameraRoll_compileSdkVersion=31 +ReactNativeCameraRoll_compileSdkVersion=33 ReactNativeCameraRoll_buildToolsVersion=29.0.2 ReactNativeCameraRoll_targetSdkVersion=31 ReactNativeCameraRoll_minSdkVersion=23 diff --git a/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java b/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java index 9210055..32febd7 100644 --- a/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java +++ b/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java @@ -698,7 +698,11 @@ public class CameraRollModule extends ReactContextBaseJavaModule { + photoUri.toString(), e); } - retriever.release(); + try { + retriever.release(); + } catch (IOException e) { + // Do nothing. We can't handle this, and this is usually a system problem + } } if (photoDescriptor != null) { @@ -765,7 +769,11 @@ public class CameraRollModule extends ReactContextBaseJavaModule { + photoUri.toString(), e); } - retriever.release(); + try { + retriever.release(); + } catch (IOException e) { + // Do nothing. We can't handle this, and this is usually a system problem + } } else { BitmapFactory.Options options = new BitmapFactory.Options(); // Set inJustDecodeBounds to true so we don't actually load the Bitmap, but only get its