1.在使用第三库react-native-image-crop-picker图片选择库的时候,在xCode中配置不正确,导致使用react-native run-ios启动应用就闪退,但是xCode启动就没有问题。
配置过程:
首先配置所需要的权限:
(1)声明权限
在Xcode中打开Info.plist,并添加带有值的字符串键NSPhotoLibraryUsageDescription,描述为什么需要访问用户照片 以及NSCameraUsageDescription和NSMicrophoneUsageDescription。

(2)添加依赖
Cocapods的用户
1> 在Deployment Info标签下,设置Deployment Target平台版本为:8.0'
2> 将pod'RSKImageCropper'和pod'QBImagePickerController'添加到Podfile
非Cocapods用户
2> 单info选项卡
在Deployment Info标签下,设置Deployment Target平台版本为:8.0'

在Target下点击General,选择Embedded Binaries单击+并添加RSKImageCropper.framework和QBImagePicker.framework

然后就可以愉快的进行写代码了。
网友评论