bamlab / react-native-image-resizer

🗻 Resize local images with React Native
MIT License
1.59k stars 338 forks source link

TypeError: Cannot read property 'createResizedImage' of null in Android #373

Closed isak-sayyed closed 12 months ago

isak-sayyed commented 1 year ago

In the function below, I am including all the required parameters: createResizedImage( path, 960, 1280, 'JPEG', 80 );

but getting TypeError: Cannot read property 'createResizedImage' of null in Android

cyrilbo commented 1 year ago

Hi, can you provide a reproducible example ?

isak-sayyed commented 1 year ago

I am using same code snippet provided in the documentation for the method createResizedImage and passing all the mandotry parameters and I am getting this error

cyrilbo commented 1 year ago

Did you rebuild your android app after adding the dependency ? I can't reproduce your issue on my side. Can you share a public git repo where the issue is reproducible so that I can have a look ?

chaos2171053 commented 1 year ago

In READ ME-Manual linking,package name is wrong in android,should be com.reactnativeimageresizer.ImageResizerPackage."Since version 3.0.0 this library has been moved from react-native-image-resizer to @bam.tech/react-native-image-resizer"

w3company-leo commented 1 year ago

not working same I think the install doc is wrong

UrielCh commented 1 year ago

Not working on android, uninstalling @bam.tech/react-native-image-resizer fix all my issues 👯

v2stech-solution commented 1 year ago

Same issue with me. Possible Unhandled Promise Rejection (id: 0): TypeError: null is not an object (evaluating 'ImageResizer.createResizedImage')

with react-native-image-resizer it works fine but after replacing with @bam.tech/react-native-image-resizer this error is comes

taboulot commented 12 months ago

The example app inside this project is working on android (you can pull the repository & test it).

It means that there is a difference between our setup & your setup. The error might be in the code or documentation but without a minimal & simple repeatable example, it is going to be difficult to help.

@v2stech-solution, @isak-sayyed, @w3company-leo, or @UrielCh, is it possible for you do that?

taboulot commented 12 months ago

@isak-sayyed,

Did a small example here with 3.0.5 & everything just work fine.

If you did a manual install @chaos2171053 already fixed the documentation in this PR #366.

I close it. i let you reopen if you still have any problems.

LuisBonsembiante commented 5 months ago

@taboulot why you closed this issue if still happen....Im install the lib @bam.tech/react-native-image-resizer at this moment...and get the same issue TypeError: Cannot read property 'createResizedImage' of null

taboulot commented 5 months ago

@LuisBonsembiante Since 12 June 2023, @cyrilbo & I asked for a minimal example. We do not reproduce it on our side. Without this example we can do nothing. If you have one, please share it with us & we will reopen it.