souvik-ghosh / react-native-create-thumbnail

iOS/Android thumbnail generator with support for both local and remote videos
MIT License
246 stars 105 forks source link

Build error in ANDROID SDK 33 #98

Closed hdh0319 closed 8 months ago

hdh0319 commented 1 year ago

This pakcage support Android sdk 33? An error occurs during build.

AlekoG commented 1 year ago

Same thing: Task :react-native-create-thumbnail:compileDebugJavaWithJavac FAILED

After upgrading to 33 its not building.

joaohedy commented 1 year ago

Same issue. Using React Native 0.70.6 Tried the previous stable version and now 2.0.0-rc.2 I managed to return to 31 and it worked fine. but other libraries require 33.

So If no solution is available, I need to find another library that works. :-(

bryancisler commented 1 year ago

Fork and clone the project. Go to the android/src/main/java/com/createthumbnail/CreateThumbnailModule.hava file.

Go to line 191 and replace the code

     Bitmap image = retriever.getFrameAtTime(time * 1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
        retriever.release();
        if (image == null) {
            throw new IllegalStateException("File doesn't exist or not supported");
        }
        return image; 

to this

 Bitmap image = retriever.getFrameAtTime(time * 1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
try {
    retriever.release();
} catch (Exception e) { // Catching Exception class as it's unclear what specific exception you're facing
    // Handle or log the exception here
    e.printStackTrace();
}

if (image == null) {
    throw new IllegalStateException("File doesn't exist or not supported");
}
return image;
padulamathias commented 1 year ago

Hello,

From Aug 31 API 33 is the minimum supported for sending updates to the Play Store.

I am having the same issue using the last version of react-native-create-thumbnail.

React Native: 0.71.6

humanzai commented 1 year ago

Opened a PR #100 with a fix Relates to #96

xgenem commented 9 months ago

Using the version 2.0.0-rc.2. Problem still persists.

souvik-ghosh commented 8 months ago

duplicate of https://github.com/souvik-ghosh/react-native-create-thumbnail/issues/76. fixed in the latest version