souvik-ghosh / react-native-create-thumbnail Goto Github PK
View Code? Open in Web Editor NEWiOS/Android thumbnail generator with support for both local and remote videos
License: MIT License
iOS/Android thumbnail generator with support for both local and remote videos
License: MIT License
Describe the bug
iOS 1.2.0 incorrect lowercase the source url that makes file not found issue on iOS (it's file system is case sensitive).
To Reproduce
Steps to reproduce the behavior:
react-native-create-thumbnail
FileNotSupportedException
Version
1.2.0
/Users/macHome/Documents/codes/heavenya/mobile/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:192: error: unreported exception IOException; must be caught or declared to be thrown retriever.release();
This error happens when i change compileSdkVersion and targetSdkVersion from 31 to 33
I use react-native-image-crop-picker to take a picture using the camera and when I pass the path of the image to createThumbnail I get this error: "File doesn't exist or not supported".
Here is my code:
ImagePicker.openCamera({
width: windowFrame.width,
height: windowFrame.height,
cropping: true
}).then(async response => {
createThumbnail({
url: response.path,
timeStamp: 10000,
})
.then(response => console.log({ response }))
.catch(err => console.log({ err })) }
The response.path looks like this: "/private/var/mobile/Containers/Data/Application/RR62F5C8-26F5-4B9A-8A3F-3D65BE6207FF/tmp/react-native-image-crop-picker/A90DD27F-6E4E-4E70-B678-D595D84A13F9.jpg"
Please can someone tell me where I got this wrong? Thanks.
Here is my project configuration
{
"react-native-create-thumbnail": "^1.0.5",
"react": "16.9.0",
"react-native": "0.61.5",
}
/Users/machd/Desktop/SwapanilJain/Live/YoungCreators/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:71: error: cannot find symbol
file.createNewFile();
^
symbol: variable file
location: class CreateThumbnailModule
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-create-thumbnail:compileDebugJavaWithJavac'.
Describe the bug
Hi, thank you for your library, I'm having a slight problem, I'm able to generate thumbnail successfully, but the Image that is being generated has rotation, see the image
To Reproduce
Steps to reproduce the behavior:
const [videoThumbPath, setVideoThumbPath] = useState('');
createThumbnail({
url: PATH_TO_LOCAL_VIDEO_FROM_DEVICE,
})
.then(({ path }) => {
setVideoThumbPath(path);
});
<Image source={{ uri: videoThumbPath }} />
Version
react-native-create-thumbnail
1.2.1
Expected Results
Thumbnail is rotated, as a result, I have to manually set transform: [ rotate: '0deg' ]
style in Image component, and I don't want to do that, because it is creating other probloems
I am facing this error continuously
My url is this url: 'https://usaupload.com/video/embed/5kDc/640x320/00005.mp4',
Describe the bug
While compile the app getting error * Where:
Build file '...../node_modules/react-native-create-thumbnail/android/build.gradle' line: 114
Could not resolve all files for configuration ':react-native-create-thumbnail:implementation'.
Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-create-thumbnail
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out
To Reproduce
Steps to reproduce the behavior:
Run the app for android with latest react native configuration
Version
"react": "18.2.0",
"react-native": "0.70.3",
"react-native-create-thumbnail": "^1.6.3"
App should be compile and run on device
Describe the bug
The video uri is valid and playing in react-native-video but thumbnail is not being created showing wrror
Version
^1.2.1
createThumbnail({
url: path,
timeStamp: 10000,
})
.then( (response) =>{
console.log("Thumnnail path" , response );
if(response.path){
this.setState({
imageUri:response.path
})
}
} )
When Im trying this with a youtube video URL it is giving me the below error:
setDataSource failed: status = 0x80000000
I followed the example code and am using React Native CLI
I get this error when i try to build my app.
******\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java:27: error: package org.apache.commons.io.comparator does not exist import org.apache.commons.io.comparator.LastModifiedFileComparator; ^ ****\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java:94: error: cannot find symbol Arrays.sort(files, LastModifiedFileComparator.LASTMODIFIED_COMPARATOR); ^ symbol: variable LastModifiedFileComparator location: class CreateThumbnailModule Note: ****\node_modules\react-native-create-thumbnail\android\src\main\java\com\createthumbnail\CreateThumbnailModule.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors
"react-native": "^0.62.2", "react-native-create-thumbnail": "^1.2.1"
Hi, thanks for the useful library.
I'm wondering if createThumbnail
generates a new jpeg on every call, regarding if url
is the same. Because if so, I imagine it will quickly fill a lot of storage with unused images.
node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:194: error: exception IOException is never thrown in body of corresponding try statement
} catch(IOException e) {
^
try {
retriever.release();
} catch(IOException e) { <------- here
e.printStackTrace();
}
I'm trying to generate a thumbnail for a remote mp4 video. When calling createThumbnail()
the app freezes and never recovers. This is the repeating log from Android Studio.
2020-03-06 11:25:01.702 15987-16013/com.egn.memberapp W/MediaHTTPConnection: readAt 8470170 / 32768 => java.net.ProtocolException
2020-03-06 11:25:04.706 15987-16013/com.egn.memberapp D/MediaHTTPConnection: setReadTimeout with 15000ms
2020-03-06 11:25:04.707 15987-16013/com.egn.memberapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2020-03-06 11:25:04.708 15987-16013/com.egn.memberapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2020-03-06 11:25:04.960 15987-16013/com.egn.memberapp I/MediaHTTPConnection: response code = 200
2020-03-06 11:25:05.064 15987-16241/com.egn.memberapp D/MediaHTTPConnection: setReadTimeout with 15000ms
2020-03-06 11:25:05.065 15987-16241/com.egn.memberapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2020-03-06 11:25:05.066 15987-16241/com.egn.memberapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2020-03-06 11:25:05.313 15987-16241/com.egn.memberapp I/MediaHTTPConnection: response code = 200
2020-03-06 11:25:05.314 15987-16241/com.egn.memberapp E/MediaHTTPConnection: java.net.ProtocolException
at android.media.MediaHTTPConnection.seekTo(MediaHTTPConnection.java:383)
at android.media.MediaHTTPConnection.readAt(MediaHTTPConnection.java:414)
at android.media.MediaHTTPConnection.native_readAt(Native Method)
at android.media.MediaHTTPConnection.readAt(MediaHTTPConnection.java:403)
at android.media.IMediaHTTPConnection$Stub.onTransact(IMediaHTTPConnection.java:143)
at android.os.Binder.execTransactInternal(Binder.java:1021)
at android.os.Binder.execTransact(Binder.java:994)
2020-03-06 11:25:05.315 15987-16241/com.egn.memberapp W/MediaHTTPConnection: readAt 8470170 / 32768 => java.net.ProtocolException
2020-03-06 11:25:05.318 15987-16092/com.egn.memberapp E/MediaMetadataRetrieverJNI: getFrameAtTime: videoFrame is a NULL pointer
2020-03-06 11:25:05.328 15987-16091/com.egn.memberapp I/ReactNativeJS: 'TCL: VideoThumbnail -> err', [Error: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference]
I'm testing on a real device Samsung Note SM-N975F Android 10, and this is my system info:
System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Memory: 814.18 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
npm: 6.13.7 - ~/.nvm/versions/node/v12.14.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 26, 27, 28, 29
Build Tools: 28.0.2, 28.0.3, 29.0.2
System Images: android-27 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
Getting the following error on Android and iOS when just importing the library like this:
import { createThumbnail } from "react-native-create-thumbnail";
Environment:
npm -version: 6.9.0
node --version: v10.16.1
expo cli version: 3.13.1
package.json dependencies:
"react": "16.8.3", "react-dom": "16.8.3" "expo": "^35.0.0", "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz", "react-native-create-thumbnail": "^1.0.5",
android studio build warning:
API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
android studio version:4.0.1
react-native version: 0.63.2
While using api 29 or 30 the lib just doesn't work after giving it the correct file path it throws error:null,
whereas if I use it on api 28 it works. I couldn't find the issue I am also using react-native-media-meta which is having the same issue but the lib is not getting maintained anymore.
Is just a question, what will happen when dirSize reaches maxLimit (eg : 100MB) ?
Will it empty cache directory for new files ?
I am getting this error :-
A problem occurred configuring project ':react-native-create-thumbnail'.
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
Hello, i am getting this error
Error: Requiring module "node_modules\react-native-create-thumbnail\index.js", which threw an exception: TypeError: Cannot read property 'create' of null, js engine: hermes
{"err": [TypeError: Cannot read property 'createThumbnail' of undefined]}
Getting Black Image when i capture a thumbnail
below is my code for example:
<VideoPlayer resizeMode='stretch' thumbnail={{uri: 'file:///data/user/0/com/myfirstproject/cache/thumbnails/thumb-6d12fb87-4200-4a52-85ab-d9a0efa3720f.jpeg'}} repeat={false} playWhenInactive={false} video={{uri: urii}} style={{ maxWidth: '100%', height: 250, padding: 0, margin: 0 }} mediaPlaybackRequiresUserAction = {true} />
Package works perfectly on Android, but when creating thumbnails on iOS, both the height
and width
of the image are 0.
> Task :react-native-create-thumbnail:androidJavadoc
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:12: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Arguments;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:13: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Promise;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:14: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:15: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactContextBaseJavaModule;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:16: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactMethod;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:17: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReadableMap;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:18: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.WritableMap;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:20: error: package org.apache.commons.io.comparator does not exist
import org.apache.commons.io.comparator.LastModifiedFileComparator;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:31: error: cannot find symbol
public class CreateThumbnailModule extends ReactContextBaseJavaModule {
^
symbol: class ReactContextBaseJavaModule
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:33: error: cannot find symbol
private final ReactApplicationContext reactContext;
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:35: error: cannot find symbol
public CreateThumbnailModule(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:46: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class ReadableMap
location: class CreateThumbnailModule
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:46: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class Promise
location: class CreateThumbnailModule
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:7: error: package com.facebook.react does not exist
import com.facebook.react.ReactPackage;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:8: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.NativeModule;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:9: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:10: error: package com.facebook.react.uimanager does not exist
import com.facebook.react.uimanager.ViewManager;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:11: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.JavaScriptModule;
^
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:13: error: cannot find symbol
public class CreateThumbnailPackage implements ReactPackage {
^
symbol: class ReactPackage
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class NativeModule
location: class CreateThumbnailPackage
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ViewManager
location: class CreateThumbnailPackage
/home/andra/Projects/Wargaa-App/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:45: error: cannot find symbol
@ReactMethod
^
symbol: class ReactMethod
location: class CreateThumbnailModule
24 errors
> Task :react-native-create-thumbnail:androidJavadoc FAILED
Step to reproduce:
yarn run android
In Android once I select the video from the gallery and I'm trying to create the thumbnail via video path in local storage getting the error.
Here the video path:
let response = {
"path": "/storage/emulated/0/DCIM/Camera/VID_20201001_112300280.mp4",
"uri": "content://media/external/video/media/160894"
}
Version
react-native-create-thumbnail - ^1.2.1
Android version - 6.0
Expected Results
In iOS Working fine but in android getting error in catch block:
Error: [Error: setDataSource failed: status = 0x80000000]
Code
createThumbnail({
url: response.path,
timeStamp: 10000,
})
.then((response) => {
console.log('response=', response);
//this.uploadVideoThumbnailOnAWS(response.path);
})
.catch((err) => console.log('error=', err));
Also tried with the Uri key instead of the path key but getting the same issue.
can we add video time duration and video symbol on thumbnail, or any work around it
I keep having the following notorious 34 errors no matter what I do. I have tried the latest 10 versions and got the same results. And these errors have been reported overtimes and have never receive attention. I have tried all the recommendations and these errors still persist!
Task :react-native-create-thumbnail:androidJavadoc
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:12: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Arguments;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:13: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.GuardedResultAsyncTask;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:14: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Promise;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:15: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:16: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:17: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactContextBaseJavaModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:18: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactMethod;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:19: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReadableMap;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:20: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.WritableMap;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:36: error: cannot find symbol
public class CreateThumbnailModule extends ReactContextBaseJavaModule {
^
symbol: class ReactContextBaseJavaModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:38: error: cannot find symbol
private final ReactApplicationContext reactContext;
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:40: error: cannot find symbol
public CreateThumbnailModule(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:51: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class ReadableMap
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:51: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class Promise
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:55: error: cannot find symbol
private static class ProcessDataTask extends GuardedResultAsyncTask {
^
symbol: class GuardedResultAsyncTask
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:55: error: cannot find symbol
private static class ProcessDataTask extends GuardedResultAsyncTask {
^
symbol: class ReadableMap
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:57: error: cannot find symbol
private final Promise promise;
^
symbol: class Promise
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:58: error: cannot find symbol
private final ReadableMap options;
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class ReactContext
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class Promise
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:68: error: cannot find symbol
protected ReadableMap doInBackgroundGuarded() {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:132: error: cannot find symbol
protected void onPostExecuteGuarded(ReadableMap readableArray) {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:7: error: package com.facebook.react does not exist
import com.facebook.react.ReactPackage;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:8: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.NativeModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:9: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:10: error: package com.facebook.react.uimanager does not exist
import com.facebook.react.uimanager.ViewManager;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:11: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.JavaScriptModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:13: error: cannot find symbol
public class CreateThumbnailPackage implements ReactPackage {
^
symbol: class ReactPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class NativeModule
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ViewManager
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:50: error: cannot find symbol
@ReactMethod
^
symbol: class ReactMethod
location: class CreateThumbnailModule
34 errors
Task :react-native-create-thumbnail:androidJavadoc FAILED
Hello!
When I try to deploy the app, I am getting the bug with:
> Task :react-native-create-thumbnail:compileReleaseJavaWithJavac FAILED
/Users/runner/work/1/s/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:192: error: unreported exception IOException; must be caught or declared to be thrown
retriever.release();
I found the solution, we should to change line 192 with:
try {
retriever.release();
} catch (IOException ex) {
// handle the exception here
}
Could you do it ASAP, please, cause I can't deploy my app.
Thank you!
No virtual method get exceptionhandler Unable to create thumnail in android
Clone your project and run the project from example folder
"dependencies": {
"react": "18.0.0",
"react-native": "0.69.5",
"react-native-create-thumbnail": "file:../"
},
Testing on Android 11 emulator
Snack, code example, screenshot, or link to a repository
import React, {useState} from 'react';
import {
Image,
Text,
View,
StyleSheet,
TextInput,
Button,
ActivityIndicator,
} from 'react-native';
import {createThumbnail} from 'react-native-create-thumbnail';
const placeholderImage = require('./assets/placeholder-image.png');
export default function App() {
const [path, setPath] = useState('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4');
const [thumbnail, setThumbnail] = useState('');
const [timeStamp, setTimeStamp] = useState('1000');
const [isLoading, setIsLoading] = useState(false);
return (
<View style={styles.container}>
<Text style={styles.welcome}>☆CreateThumbnail example☆</Text>
<TextInput
value={path}
onChangeText={setPath}
style={styles.pathInput}
placeholder="Paste video url"
placeholderTextColor="lightgrey"
/>
<TextInput
keyboardType="numeric"
value={timeStamp}
onChangeText={setTimeStamp}
style={styles.timeInput}
placeholder="Timestamp"
/>
<Button
title="Generate Thumbnail"
disabled={isLoading}
onPress={generateThumbnail}
/>
<Text style={styles.welcome}>☆THUMBNAIL☆</Text>
<View style={styles.image}>
{isLoading ? (
<ActivityIndicator size="large" />
) : (
<Image
style={styles.image}
source={thumbnail ? {uri: thumbnail} : placeholderImage}
/>
)}
</View>
</View>
);
async function generateThumbnail() {
if (!path) {
return;
}
setIsLoading(true);
try {
const response = await createThumbnail({
url: path,
timeStamp: parseInt(timeStamp, 10),
});
setThumbnail(response.path);
} catch (err) {
console.error(err);
} finally {
setIsLoading(false);
}
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 20,
color: 'black',
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 20,
},
image: {
height: 150,
width: 250,
backgroundColor: 'lightgrey',
justifyContent: 'center',
},
pathInput: {
backgroundColor: '#eaeaea',
width: '80%',
paddingHorizontal: 10,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
timeInput: {
backgroundColor: '#eaeaea',
width: '40%',
paddingHorizontal: 10,
margin: 20,
color: 'black',
borderColor: 'lightgrey',
borderWidth: 1,
},
});
Describe the bug
Hello. Iam facing the bug on android when creating a thumbnail.
To Reproduce
Steps to reproduce the behavior:
Version
react-native
0.64.2
react-native-create-thumbnail
1.4.1
Expected Results
1s thumbnail made by ios and second by android.
Snack, code example, screenshot, or link to a repository
const thumbnail = await createThumbnail({
url: content.uri, // content - response from ImagePicker react-native-image-picker@^3.8.1:
format: 'jpeg',
})
Describe the bug
While compile the app getting error Could not resolve all files for configuration ':react-native-create-thumbnail:implementation'.
To Reproduce
Steps to reproduce the behavior:
Version
"react": "18.0.0",
"react-native": "0.69.1",
"react-native-create-thumbnail": ^1.5.1
Describe the bug
react-native run-android command execute it is stopped and give me an error like Task :react-native-create-thumbnail:compileDebugJavaWithJavac
To Reproduce
Steps to reproduce the behaviour:
1../gradlew clean
2. node_module folder delete and npm install
Version
react-native-create-thumbnail
:^1.2.1
"react": "16.13.1",
"react-native": "0.63.2",
more info
/...path/app/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:94: error: cannot find symbol
Arrays.sort(files, LastModifiedFileComparator.LASTMODIFIED_COMPARATOR);
^
symbol: variable LastModifiedFileComparator
location: class CreateThumbnailModule
Note: /...path/app/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
All generated images are saved to android gallery. Is there a prop that can be set to remove thumbnails after generation?
Describe the bug
Unable to compile react-native-create-thumbnail
for Android SDK v.33 Tiramisu (Android 13).
To Reproduce
Steps to reproduce the behaviour:
react-native-create-thumbnail
build.gradle
: compileSdkVersion = 33
targetSdkVersion = 33
Version
react-native-create-thumbnail
1.5.1
Expected Results
Successful app build
Actual Result
The following compilation error appears:
<project-path>/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:192: error: unreported exception IOException; must be caught or declared to be thrown
retriever.release();
^
i want to access thumb nail from local device file using react-native-video-player. below is my code
<VideoPlayer resizeMode='stretch' thumbnail={{uri: 'file:///data/user/0/com/myfirstproject/cache/thumbnails/thumb-6d12fb87-4200-4a52-85ab-d9a0efa3720f.jpeg'}} repeat={false} playWhenInactive={false} video={{uri: urii}} style={{ maxWidth: '100%', height: 250, padding: 0, margin: 0 }} mediaPlaybackRequiresUserAction = {true} />
Describe the bug
press the icon to start create thumbnail and then JS frame rate drop to zero
in fact i have a list and i should create thumbnail when mount, and in such scenario app even freeze!
To Reproduce
Steps to reproduce the behavior:
Version
react-native-create-thumbnail
version ^1.4.1
Expected Results
app not freeze when create thumbnail
Snack, code example, screenshot, or link to a repository
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
Describe the bug
When navigating to a new screen that has a few thumbnail components the navigation animation stutters because (I imagine) the thumbnails are being generated in the UI thread.
To Reproduce
createThumbnail
on useEffect)Version
1.2.1
Expected Results
The navigation animation runs smoothly and the thumbnails are generated asynchronously.
I tried installing this package for the purpose of creating thumbnails out of video but as soon as i import it, expo throws error (mentioned in the title).
One other error that comes along is:-
Invariant Violation: "main" has not been registered. This can happen if:
AppRegistry.registerComponent
wasn't called.I'm using the latest version of this package and I'm hoping some answer very soon. Can someone please help here?
Describe the bug
I'm using react-native-image-crop-picker to take a video; the path is passed to the createThumbnail function, but even through I get a response, it looks like the file hasn't been created.
I'm testing on a Huawei P40 lite 5G, and it happens both on the development and release apk builds.
My coworkers told me that the aab from the play store works correctly on other devices, so it may be affecting Huawei devices only.
To Reproduce
Happens in any apk build, both in release and development mode on Huawei devices
Version
react-native-create-thumbnail
version 1.5.1
react-native: 0.67.4
Expected Results
The thumbnail is generated
Snack, code example, screenshot, or link to a repository
const path = "file:///storage/emulated/0/Android/data/com.example/files/Pictures/video-9f84865d-f2a7-498c-8682-cf1cdac081597870956076344084936.mp4"
RNFS.exists(path) -> true
const newPath = "file:///data/user/0/com.example/cache/thumbnails/thumb-61cc418f-c84d-4d78-8c98-b8bc148bad38"
RNFS.exists(newPath) -> false
Is just a question, what will happen when dirSize reaches maxLimit (eg : 100MB) ?
Will it empty cache directory for new files ?
The function on iOS throws an error as follows:
[Error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (1718449215), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x600001cd4390 {Error Domain=NSOSStatusErrorDomain Code=1718449215 "(null)" UserInfo={AVErrorFourCharCode='fmt?'}}}]
I have used the following code under the useEffect
.
createThumbnail({
cacheName: attachment.title,
format: 'png',
url: attachment.asset_url,
})
.then((response) => {
setThumbnail(response.path);
})
.catch((error) => {
console.log(error);
});
On Android, it works well without any issues.
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:
Version
latest
Haven't added any code yet, so this is simply with a fresh install and importing the module.
Describe the bug
Create thumbnail keeps on loading in production android application. Its working fine in apk and in local.
To Reproduce
Steps to reproduce the behavior:
Version
1.2.2
Expected Results
Thumbnail should be generated without any issues in production also
I got this error at some of videos only in ios
[Error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed"
UserInfo={
NSLocalizedFailureReason=An unknown error occurred(1718449215),
NSLocalizedDescription=The operation could not be completed,
NSUnderlyingError=0x60000016e520 {
Error Domain=NSOSStatusErrorDomain Code=1718449215 "(null)"
UserInfo={
AVErrorFourCharCode='fmt?'
}
}
}
]
version
react: 18.0.0
react-native: 0.69.1
react-native-create-thumbnail: 1.6.4
Describe the bug
Hello, thanks for creating this library, it's very useful and great. But, I'm facing a bug during the Android compilation as shown below:
Version
react-native-create-thumbnail
1.5.0
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
build.gradle
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
// supportLibVersion = "28.0.0" // default: 23.1.1
googlePlayServicesAuthVersion = "19.2.0"
kotlinVersion = "1.5.30"
androidXAnnotation = "1.1.0"
androidXBrowser = "1.0.0"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.10'
}
}
Describe the bug
Cannot build for Android, got Task :react-native-create-thumbnail:androidJavadoc FAILED
To Reproduce
Steps to reproduce the behavior:
npm run android
or ./gradlew build
in android
folder./gradlew clean
and even rm -rf ~/.gradle/caches/*
, no effect.Version
react-native-create-thumbnail
version 1.5.1
Expected Results
Able to build.
Snack, code example, screenshot, or link to a repository
> Task :react-native-create-thumbnail:androidJavadoc
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:12: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Arguments;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:13: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.GuardedResultAsyncTask;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:14: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.Promise;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:15: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:16: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:17: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactContextBaseJavaModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:18: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactMethod;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:19: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReadableMap;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:20: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.WritableMap;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:36: error: cannot find symbol
public class CreateThumbnailModule extends ReactContextBaseJavaModule {
^
symbol: class ReactContextBaseJavaModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:38: error: cannot find symbol
private final ReactApplicationContext reactContext;
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:40: error: cannot find symbol
public CreateThumbnailModule(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:51: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class ReadableMap
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:51: error: cannot find symbol
public void create(ReadableMap options, Promise promise) {
^
symbol: class Promise
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:55: error: cannot find symbol
private static class ProcessDataTask extends GuardedResultAsyncTask<ReadableMap> {
^
symbol: class GuardedResultAsyncTask
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:55: error: cannot find symbol
private static class ProcessDataTask extends GuardedResultAsyncTask<ReadableMap> {
^
symbol: class ReadableMap
location: class CreateThumbnailModule
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:57: error: cannot find symbol
private final Promise promise;
^
symbol: class Promise
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:58: error: cannot find symbol
private final ReadableMap options;
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class ReactContext
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class Promise
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:60: error: cannot find symbol
protected ProcessDataTask(ReactContext reactContext, Promise promise, ReadableMap options) {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:68: error: cannot find symbol
protected ReadableMap doInBackgroundGuarded() {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:132: error: cannot find symbol
protected void onPostExecuteGuarded(ReadableMap readableArray) {
^
symbol: class ReadableMap
location: class ProcessDataTask
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:7: error: package com.facebook.react does not exist
import com.facebook.react.ReactPackage;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:8: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.NativeModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:9: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.ReactApplicationContext;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:10: error: package com.facebook.react.uimanager does not exist
import com.facebook.react.uimanager.ViewManager;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:11: error: package com.facebook.react.bridge does not exist
import com.facebook.react.bridge.JavaScriptModule;
^
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:13: error: cannot find symbol
public class CreateThumbnailPackage implements ReactPackage {
^
symbol: class ReactPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:15: error: cannot find symbol
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
^
symbol: class NativeModule
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ReactApplicationContext
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailPackage.java:20: error: cannot find symbol
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
^
symbol: class ViewManager
location: class CreateThumbnailPackage
/Users/username/projects/react-native-melcotoday-app-client/node_modules/react-native-create-thumbnail/android/src/main/java/com/createthumbnail/CreateThumbnailModule.java:50: error: cannot find symbol
@ReactMethod
^
symbol: class ReactMethod
location: class CreateThumbnailModule
34 errors
> Task :react-native-create-thumbnail:androidJavadoc FAILED
Description
No matter what timeStamp I put, it always create a thumbnail with the first frame. The thumbnail is rightfully created but not at the timeStamp I use. The timeStamp I try to put is equal to (video duration * 1000) / 2. The video used as reference is then played in react-native video library.
To Reproduce
Steps to reproduce the behavior:
react-native-create-thumbnail
1.6.3react-native
: 0.68,Expected Results
Describe what you expected to happen.
Snack, code example, screenshot, or link to a repository
Here is how I use the method createThumbnail
try {
const response = await createThumbnail({
url: analysis?.data?.videoLocalUri,
timeStamp: analysis?.data?.videoData?.duration
? (analysis?.data?.videoData?.duration * 1000) / 2
: 0,
});
setThumbnail(response?.path);
} catch (err) {
console.error(err);
} finally {
setStatus('success');
setLoading(false);
}
Work flow:
Create a new react-native application and try installing this package
Error Log:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: <NameOfProject>@<Version of package>
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.1" from [email protected]
npm ERR! node_modules/react-native-create-thumbnail
npm ERR! react-native-create-thumbnail@"1.4.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See <Path to .npm folder>/eresolve-report.txt for a full report.
Proposed Solution:
This is because the package.json looks for explicit dependency on react and react-native.
Since they are peer dependencies and does not affect actual functionality
Replace
"peerDependencies": {
"react": "^16.8.1",
"react-native": ">=0.59.0-rc.0 <1.0.x"
}
with
"peerDependencies": {
"react": ">=16.8.1",
"react-native": ">=0.59.0-rc.0 <1.0.x"
}
and publish a new version of the package.
Note:
Though this is the solution I propose with great confidence, I'd advise and request the maintainer to check if this is the only change required for solving the issue.
After installing the package my app is getting a native crash the moment I start the app and getting error :
Caused by: java.lang.ClassNotFoundException: Didn't find class "package.name.MainApplication" on path: DexPathList[....]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.