Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreported exception error IOException; it must be caught or declared to be thrown. "retriever.release()" #96

Closed
DiaoMIngHero opened this issue Jun 28, 2023 · 7 comments
Labels
duplicate This issue or pull request already exists

Comments

@DiaoMIngHero
Copy link

Describe the bug
image

To Reproduce
1.add dependency
2.run

Version
react-native-create-thumbnail 1.6.4

Expected Results
no exception

Snack, code example, screenshot, or link to a repository

@DiaoMIngHero DiaoMIngHero added the bug Something isn't working label Jun 28, 2023
@yoon123456
Copy link

I have the same problem.
please solve

@MichaelDanielTom
Copy link

The easiest way to fix until prs are approved is to use patch-package to add those two errors in java like:

diff --git a/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java b/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java
index 9bd67d8..6188e43 100644
--- a/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java
+++ b/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java
@@ -168,7 +168,7 @@ public class CreateThumbnailModule extends ReactContextBaseJavaModule {
         return dir;
     }
 
-    private static Bitmap getBitmapAtTime(Context context, String filePath, int time, Map headers) {
+    private static Bitmap getBitmapAtTime(Context context, String filePath, int time, Map headers) throws IOException, IllegalStateException {
         MediaMetadataRetriever retriever = new MediaMetadataRetriever();
         if (URLUtil.isFileUrl(filePath)) {
             String decodedPath;

@Shiva207892
Copy link

try {
// Code that may throw an IOException
retriever.release();
} catch (IOException e) {
// Handle the IOException, you can log it or take appropriate actions.
e.printStackTrace();
}

@mattlewer
Copy link

mattlewer commented Jul 7, 2023

@souvik-ghosh Same problem here, preventing us running a new build.

"react-native": "0.72.1"
"react-native-create-thumbnail": "1.6.4"

Tried '2.0.0-rc.2' but no luck there either.

@saif-o99
Copy link

@souvik-ghosh Same here with:

"react-native": "0.71.7"
"react-native-create-thumbnail": "1.6.4"

@MarcoBallotti
Copy link

try { // Code that may throw an IOException retriever.release(); } catch (IOException e) { // Handle the IOException, you can log it or take appropriate actions. e.printStackTrace(); }

this solved for me

@souvik-ghosh souvik-ghosh added duplicate This issue or pull request already exists and removed bug Something isn't working labels Dec 29, 2023
@souvik-ghosh
Copy link
Owner

Duplicate of #76

@souvik-ghosh souvik-ghosh marked this as a duplicate of #76 Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

8 participants