vemarav / react-native-avatar-crop

Highly customisable <Crop /> component for React Native < 💅 >
https://www.npmjs.com/package/react-native-avatar-crop
MIT License
54 stars 14 forks source link

Works on iOS, null is not an object(evaluating 'RNImageSize.getSize') on android #7

Closed minuitagency closed 2 years ago

minuitagency commented 2 years ago

Hi,

We use a very classic implementation:

<Crop cropShape={'rect'} source={{uri: picturePath}} width={'100%'} height={responsiveHeight(40)} cropArea={{ width: CROPPING_ZONE, height: CROPPING_ZONE * aspectRatio, }} onCrop={cropCallback => (crop = cropCallback)} />

Installed the library from the git you mentioned:

image

Everything works perfectly on iOS but on android we get the following error:

null is not an object(evaluating 'RNImageSize.getSize')

Any idea?

Thanks again for the great library, you were able to solve for us an important feature of our app.

Théo

vemarav commented 2 years ago

@minuitagency can you create a reproducible public repo and tag me so that I can check

minuitagency commented 2 years ago

Hi @vemarav thanks so much for your help, here's the source code of the project:

https://github.com/minuitagency/reproCropper

Thanks,

Théo

vemarav commented 2 years ago

@minuitagency yarn add react-native-image-size or npm install react-native-image-size will fix the issue. I have created a PR here https://github.com/minuitagency/reproCropper/pull/1/files