Skip to content

Commit

Permalink
Fix cameraroll issue
Browse files Browse the repository at this point in the history
  • Loading branch information
UrazAkgultan committed Aug 22, 2023
1 parent bd08c69 commit 61f9f43
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"dependencies": {
"@mendix/native": "~2.0.1",
"@mendix/react-native-sqlite-storage": "5.1.3",
"@react-native-community/async-storage": "1.12.1",
"@react-native-community/cameraroll": "4.0.1",
"@react-native-community/datetimepicker": "3.0.3",
Expand All @@ -22,13 +23,12 @@
"react-native-fast-image": "8.3.2",
"react-native-gesture-handler": "1.10.3",
"react-native-image-picker": "5.0.1",
"react-native-permissions": "3.3.1",
"react-native-localize": "1.4.2",
"react-native-permissions": "3.3.1",
"react-native-push-notification": "8.1.1",
"react-native-reanimated": "1.13.1",
"react-native-safe-area-context": "3.1.8",
"react-native-splash-screen": "3.2.0",
"@mendix/react-native-sqlite-storage": "5.1.3",
"react-native-svg": "12.1.0",
"react-native-vector-icons": "9.2.0",
"react-native-video": "5.2.1"
Expand Down
38 changes: 37 additions & 1 deletion patches/@react-native-community+cameraroll+4.0.1.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
diff --git a/node_modules/@react-native-community/cameraroll/android/gradle.properties b/node_modules/@react-native-community/cameraroll/android/gradle.properties
index 0bec1b5..a3dbe4e 100644
--- a/node_modules/@react-native-community/cameraroll/android/gradle.properties
+++ b/node_modules/@react-native-community/cameraroll/android/gradle.properties
@@ -1,4 +1,4 @@
-ReactNativeCameraRoll_compileSdkVersion=28
+ReactNativeCameraRoll_compileSdkVersion=33
ReactNativeCameraRoll_buildToolsVersion=28.0.3
ReactNativeCameraRoll_targetSdkVersion=27
ReactNativeCameraRoll_minSdkVersion=16
diff --git a/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java b/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java
index b13e570..b681c45 100644
index b13e570..bfe46b2 100644
--- a/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java
+++ b/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/CameraRollModule.java
@@ -9,6 +9,7 @@ package com.reactnativecommunity.cameraroll;
Expand Down Expand Up @@ -159,6 +169,32 @@ index b13e570..b681c45 100644
null,
new MediaScannerConnection.OnScanCompletedListener() {
@Override
@@ -633,7 +666,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) {
@@ -699,7 +736,12 @@ public class CameraRollModule extends ReactContextBaseJavaModule {
+ photoUri.toString(),
e);
}
+
+ 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
diff --git a/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/Utils.java b/node_modules/@react-native-community/cameraroll/android/src/main/java/com/reactnativecommunity/cameraroll/Utils.java
new file mode 100644
index 0000000..880802c
Expand Down

0 comments on commit 61f9f43

Please sign in to comment.