在使用react-native-image-zoom-viewer保存图片时,报错cannot read property ‘savetocameraroll’。
查找之后发现react-native-image-zoom-viewe保存图片使用的是CameraRollapi。所以我们需要在xcode中添加静态库依赖。
具体操作如下:
- 首先打开
你的项目目录/node_modules/react-native/Libraries/CameraRoll/找到RCTCameraRoll.xcodeproj这个文件。

- 然后把它拖到
xcode的Libraries目录下。

- 然后点击项目标签在
General标签中找到Linked Frameworks and Libraries点击下边的**+**号把libRCTCameraRoll.a加进来


然后再返回你的项目中保存图片应该就不会错了。