alwx / react-native-photo-view

Pinch-to-zoom view for React Native (both iOS and Android)
MIT License
815 stars 434 forks source link

IOS unable to build #93

Closed jkolbe closed 7 years ago

jkolbe commented 7 years ago

The moment i include import PhotoView from 'react-native-photo-view'; in my container and try to build the react-native app I get the following

`/node_modules/react-native-photo-view/ios/RNPhotoView.m:297:22: error: implicit declaration of function 'RCTImageFromLocalAssetURL' is invalid in C99 [-Werror,-Wimplicit-function-declaration] UIImage image = RCTImageFromLocalAssetURL(imageURL); ^ /node_modules/react-native-photo-view/ios/RNPhotoView.m:297:22: note: did you mean 'RCTIsLocalAssetURL'? In file included from /node_modules/react-native-photo-view/ios/RNPhotoView.m:7: /ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTUtils.h:115:17: note: 'RCTIsLocalAssetURL' declared here RCT_EXTERN BOOL RCTIsLocalAssetURL(NSURL nullable imageURL); ^ /node_modules/react-native-photo-view/ios/RNPhotoView.m:297:22: error: implicit conversion of 'int' to 'UIImage ' is disallowed with ARC UIImage image = RCTImageFromLocalAssetURL(imageURL); ^~~~~~~~~~~ /node_modules/react-native-photo-view/ios/RNPhotoView.m:297:14: warning: incompatible integer to pointer conversion initializing 'UIImage *strong' with an expression of type 'int' [-Wint-conversion] UIImage image = RCTImageFromLocalAssetURL(imageURL); ^ ~~~~~~~ /node_modules/react-native-photo-view/ios/RNPhotoView.m:334:22: error: implicit conversion of 'int' to 'UIImage ' is disallowed with ARC UIImage image = RCTImageFromLocalAssetURL(imageURL); ^~~~~~~~~~~ /node_modules/react-native-photo-view/ios/RNPhotoView.m:334:14: warning: incompatible integer to pointer conversion initializing 'UIImage __strong' with an expression of type 'int' [-Wint-conversion] UIImage *image = RCTImageFromLocalAssetURL(imageURL); ^ ~~~~~~~ 2 warnings and 3 errors generated.

BUILD FAILED `

alwx commented 7 years ago

Maybe the project itself is outdated and uses the old version of React Native. I am preparing the fix at this moment.

alwx commented 7 years ago

@jkolbe I've updated both library's code and example. Also verified that example works now. Please, try it.

harrisrobin commented 6 years ago

I'm having the same problem on the latest version 🙁