wowmaking / react-native-image-tools

A collection of image processing tools for React Native
MIT License
59 stars 22 forks source link

Typexception '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil #9

Closed cristea2017 closed 4 years ago

cristea2017 commented 4 years ago

code : RNImageTools.merge( [ './icons/img1.png', './icons/img2.png' ] ).then(({ uri, width, height }) => { // Sync with your app state console.log(uri); }).catch(console.error); error : Exception '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' was thrown while invoking merge on target RNImageTools with params ( ( "../../assets/icons/star.png", "../../assets/icons/star.png" ), 1812, 1813 ) node version - Node.js v13.2.0

cristea2017 commented 4 years ago

According to documentation

Parameter(s) images: Array uri: String - path to image

But when try to pass string shows error...

Solution : RNImageTools.merge([ Image.resolveAssetSource(icons.hotel_aird).uri, Image.resolveAssetSource(icons.hotel_info).uri]) .then(({ uri, width, height }) => { console.log(uri, width, height); this.setState({ img: uri }) }).catch(console.error);