react-native-create-thumbnail: Not working on Android , RN Version 0.65.1
Describe the bug Fresh install, only importing the module, this is what happens when running app:
BUILD FAILED in 12s
CreateThumbnailModule.java:194: error: exception java.io.IOException is never thrown in body of corresponding try statement
} catch(IOException e) {
CreateThumbnailModule.java uses or overrides a deprecated API.
* What went wrong:
Execution failed for task ':react-native-create-thumbnail:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
To Reproduce Steps to reproduce the behavior: on android:
- npm i react-native-create-thumbnail
- start
- run-android
Version latest
Haven’t added any code yet, so this is simply with a fresh install and importing the module.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 21 (5 by maintainers)
I handled to run v1.6.3 on rn0.70 by applying the following patch
@DanielAraldi Sorry to hear this. Could you please try v1.6.3 and confirm if it works? looks like the
namespacemethod is not supported in older Gradle versions.This is fixed in v1.6.2. The library continues to work on Android < 13. Those who are on android 13, may use 2.0.0-rc.2 (pre-release) for now.
@souvik-ghosh thanks for the solution but is there any other solution to this since setting
compileSdkVersion = 33 targetSdkVersion = 33might lead to issue with other installed libraries I am also using react-native 0.70.“react-native-create-thumbnail”: “^2.0.0-rc.2”,
In my project RN 0.63.4 is still happening. Below is my code in
android/build.gradle:Note: I updated the library version to
1.6.2and2.0.0-rc.2, it still didn’t work. In both versions, in the terminal it showed me this:This got broken when the support for android 13 was added in v1.6.0. This library now requires android API level 10 or above. It’s related to the change in the
MediaMetadataRetriever.release()API (more info here).@AlbinCederblad, The easiest solution for you would be to use v1.5.1 of this library. And to use the latest version, you can upgrade your project to react-native 69 or later, which will also upgrade the Gradle and android-build-tool versions.
I will add this to the release notes or probably publish release v2.0.0 as it’s a breaking change.
@cuteWarmFrog, Sorry, you will also need to add these to the project’s
build.gradleEdit: Sorry its Work fine whiteout edit or change.
“react-native”: “0.70.1” “react-native-create-thumbnail”: “^1.6.3”
VERSION
1.6.3WORKED! Finally a stable version haha! Thank you very much!In React Native 0.63.4 this is also happening and we are using the most current version.
I upgraded rn to 70 and still getting this error.