Closed AlbinCederblad closed 1 year ago
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](https://developer.android.com/reference/android/media/MediaMetadataRetriever#release())).
@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.
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](https://developer.android.com/reference/android/media/MediaMetadataRetriever#release())).@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.
Thanks!
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](https://developer.android.com/reference/android/media/MediaMetadataRetriever#release())).@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.
I upgraded rn to 70 and still getting this error.
@cuteWarmFrog, Can you please make sure you followed the upgrade guide? Updating just the react-native library won't work.
I upgraded using this tool. It actually works with 1.51 version
I upgraded using this tool. It actually works with 1.51 version
@cuteWarmFrog, Sorry, you will also need to add these to the project's build.gradle
compileSdkVersion = 33
targetSdkVersion = 33
@souvik-ghosh I am not sure, that I am able to up these two by 2 versions but still thank you! (tried on empty project, works)
@souvik-ghosh thanks for the solution but is there any other solution to this since setting
compileSdkVersion = 33 targetSdkVersion = 33
might lead to issue with other installed libraries
I am also using react-native 0.70.
In React Native 0.63.4 this is also happening and we are using the most current version.
In React Native 0.63.4 this is also happening and we are using the most current version.
+1
Any news?
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.
In my project RN 0.63.4 is still happening. Below is my code in android/build.gradle
:
buildscript {
ext {
buildToolsVersion = "31.0.3"
minSdkVersion = 16
compileSdkVersion = 31
targetSdkVersion = 31
googlePlayServicesVersion = "17.0.0"
googlePlayServicesVisionVersion = "19.0.0"
ndkVersion = "major.minor.build"
}
Note: I updated the library version to 1.6.2
and 2.0.0-rc.2
, it still didn't work.
In both versions, in the terminal it showed me this:
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/my_user/Documents/Projects/project/project_app/node_modules/react-native-create-thumbnail/android/build.gradle' line: 45
* What went wrong:
A problem occurred evaluating project ':react-native-create-thumbnail'.
> Could not find method namespace() for arguments [com.reactlibrary.createthumbnail] on extension 'android' of type com.android.build.gradle.LibraryExtension.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-create-thumbnail'.
> compileSdkVersion is not specified. Please add it to build.gradle
In my project RN 0.63.4 is still happening. Below is my code in
android/build.gradle
:buildscript { ext { buildToolsVersion = "31.0.3" minSdkVersion = 16 compileSdkVersion = 31 targetSdkVersion = 31 googlePlayServicesVersion = "17.0.0" googlePlayServicesVisionVersion = "19.0.0" ndkVersion = "major.minor.build" }
Note: I updated the library version to
1.6.2
and2.0.0-rc.2
, it still didn't work. In both versions, in the terminal it showed me this:1: Task failed with an exception. ----------- * Where: Build file '/Users/my_user/Documents/Projects/project/project_app/node_modules/react-native-create-thumbnail/android/build.gradle' line: 45 * What went wrong: A problem occurred evaluating project ':react-native-create-thumbnail'. > Could not find method namespace() for arguments [com.reactlibrary.createthumbnail] on extension 'android' of type com.android.build.gradle.LibraryExtension. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: A problem occurred configuring project ':react-native-create-thumbnail'. > compileSdkVersion is not specified. Please add it to build.gradle
@DanielAraldi Sorry to hear this. Could you please try v1.6.3 and confirm if it works? looks like the namespace
method is not supported in older Gradle versions.
VERSION 1.6.3
WORKED! Finally a stable version haha! Thank you very much!
Version 1.6.3
still accusing:
> Task :react-native-create-thumbnail:androidJavadoc FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-create-thumbnail:androidJavadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/x/node_modules/react-native-create-thumbnail/android/build/tmp/androidJavadoc/javadoc.options'
i have this problem. iam use "react-native": "0.70.1" i try 1.6.3 2.0.0-rc.2 and compileSdkVersion = 33 targetSdkVersion = 33 remains the same what is the solution?
I handled to run v1.6.3 on rn0.70 by applying the following patch
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..8f14cce 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
@@ -189,7 +189,11 @@ public class CreateThumbnailModule extends ReactContextBaseJavaModule {
}
Bitmap image = retriever.getFrameAtTime(time * 1000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
- retriever.release();
+ try {
+ retriever.release();
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
if (image == null) {
throw new IllegalStateException("File doesn't exist or not supported");
}
i have this problem. iam use "react-native": "0.70.1" i try 1.6.3 2.0.0-rc.2 and compileSdkVersion = 33 targetSdkVersion = 33 remains the same what is the solution?
Edit: Sorry its Work fine whiteout edit or change.
"react-native": "0.70.1" "react-native-create-thumbnail": "^1.6.3"
"react-native-create-thumbnail": "^2.0.0-rc.2",
I am having this same issue. I am on "react-native": "0.71.7" and "react-native-create-thumbnail": "^1.6.4". I have set the compileSdkVersion and targetSdkVersion to 33 respectively and it's still not building
Describe the bug Fresh install, only importing the module, this is what happens when running app:
To Reproduce Steps to reproduce the behavior: on android:
Version latest
Haven't added any code yet, so this is simply with a fresh install and importing the module.