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

error in compressing video in react native v0.65.1 #31

Closed
rnqayush opened this issue Sep 15, 2021 · 32 comments
Closed

error in compressing video in react native v0.65.1 #31

rnqayush opened this issue Sep 15, 2021 · 32 comments

Comments

@rnqayush
Copy link

1-earlier i was using react native 0.61.5 and used this library for video and image compression. it was working as expected.
2- I have upgraded react native version to 0.65.1 and now image compression is working as expected but in video compression i am having errors.
3- i am sharing the screenshot of my code and error kindly suggest some idea to resolve it.
toshob3
toshob

@numandev1
Copy link
Owner

@rnqayush I think this error is not from the compressor package.
i think it is from https://github.com/uuidjs/uuid#getrandomvalues-not-supported

can you provide reproducible example repo? so I can see it

@rnqayush
Copy link
Author

@nomi9995 thanks for you response, actually i have tested this after removing this video compressor code then it works fine but after implementing this code i get this error.

@rnqayush
Copy link
Author

@nomi9995 i made a fresh react native project and then installed this package. unfortunately i am getting error kindly look on it and suggest some idea to resolve it. also i am sharing the github repo.
GitHub: https://github.com/rnqayush/react-native-video-compressor

snapshot of error:
toshob2

@numandev1
Copy link
Owner

@rnqayush Actually this is due to jcenter, many libraries which were published on jcenter having this issue. we should have to publish all libraries to mavenCenter. I will create a ticket on mavenCenter so our library may not be down
https://developer.android.com/studio/build/jcenter-migration
image

@rnqayush
Copy link
Author

@nomi9995 thanks a lot for your response, kindly let us know when it is expected to be updated.

@numandev1
Copy link
Owner

numandev1 commented Sep 17, 2021

@rnqayush actually I did not publish the library on mavenCenter before. I am going to make a ticket on mavenCenter and then d that the community will review the ticket and then will publish or reject it. it depends on the community review.

@rnqayush
Copy link
Author

@nomi9995 sure thankyou .

@rnqayush
Copy link
Author

also @nomi9995 do it will work on ios or there too it can have issues.

@numandev1
Copy link
Owner

@rnqayush it is specifically for android

@numandev1
Copy link
Owner

numandev1 commented Sep 17, 2021

@rnqayush can you try 0.5.3-rc.0 version. it is working on my side

@ymane
Copy link

ymane commented Sep 28, 2021

I am also facing same issue with "react-native-compressor": 0.5.3 and react-native: 0.64.2
[Error: crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported]

@numandev1
Copy link
Owner

@ymane can you provide reproducible example in git repo because it is not reproducing on my side

@numandev1
Copy link
Owner

@rnqayush @ymane I just release 1.0.0 can you try the 1.0.0 version

yarn add react-native-compressor@1.0.0

@moowoonsunghoon
Copy link

i have same issue

@numandev1
Copy link
Owner

@moowoonsunghoon can you tell me your RN version and compressor version?

@moowoonsunghoon
Copy link

@nomi9995
my version is
react-native: 0.64.1
react-native-compressor: 1.0.1

@numandev1
Copy link
Owner

@moowoonsunghoon sorry for that. react-native-compressor>=1.0.0 is for react-native@0.65

you can use 0.5.6 version for the compressor

yarn add react-native-compressor@0.5.6

after this please do Invalidate Caches / Restart from android studio
image

@numandev1
Copy link
Owner

@moowoonsunghoon i will update documentation soon

@moowoonsunghoon
Copy link

@nomi9995
it's working!! thank you!!

@DavidGonzalezGutierrez
Copy link

Hello!
Same issue on iOS.
React Native version: 0.66.2
React Native Compressor: 1.0.2

@numandev1
Copy link
Owner

@DavidGonzalezGutierrez can you try this Invalidate Caches / Restart from android studio image

@DavidGonzalezGutierrez
Copy link

Yes, but is in iOS.
I clean the build folder in Xcode, and the caches of metro.
But, when I try to compress a video I recieve the error crypto.getRandomValues() not supported.

@DavidGonzalezGutierrez
Copy link

When I use UUID version 4 in my app, I always use with DEV because I read the uuidv4 has problems in development mode

@numandev1
Copy link
Owner

numandev1 commented Nov 15, 2021

@DavidGonzalezGutierrez can you try this solution uuidjs/uuid#416 (comment)

import 'react-native-get-random-values'; in index.js or App.js file

let know if it fixes it. I will make this one as a part of this package

@DavidGonzalezGutierrez
Copy link

Yes, It works!

@numandev1
Copy link
Owner

@DavidGonzalezGutierrez I also have published a new version 1.0.3 of the compressor where I added above fix

@DavidGonzalezGutierrez
Copy link

Nice work!

@ahmad0303
Copy link

@nomi9995 Hello, When I use minimumFileSizeForCompress in video it changes the file format and didn't upload with the error TypeError: Network request failed
"react-native-compressor": "^0.5.17",
"react-native": "0.64.2",
It perfectly works on images but didn't work on video

@harleenarora
Copy link

Compress video is not working on android

@avyasradicle
Copy link

Hi I am using "react-native": "0.70.1" and "react-native-compressor": "^1.7.2".
Getting error in build-

  • What went wrong:
    Could not determine the dependencies of task ':react-native-compressor:compileDebugAidl'.

Could not resolve all task dependencies for configuration ':react-native-compressor:debugCompileClasspath'.
Could not find com.github.numandev1:VideoCompressor:1a262bba37.
Required by:
project :react-native-compressor

@numandev1
Copy link
Owner

numandev1 commented Sep 4, 2023

@avyasradicle can you try this code and try to run project

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

@avyasradicle
Copy link

It worked. Thank you!! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants