因此,当尝试运行React Native Camera https://github.com/lwansbrough/react-native-camera时,我收到未定义错误的cannot read property 'Aspect‘错误

我知道这个GitHub问题https://github.com/lwansbrough/react-native-camera/issues/386
然而,我基本上已经尝试了其中的所有内容,但仍然得到错误。我真的必须在模拟器上从IOS10降级才能使用它吗?我真的不想这么做。有没有人想出任何类型的变通方法?
我运行的是版本8.1 (8B62)
我尝试手动安装,重置缓存,向RCTCameraManager.m添加代码等等。
任何帮助都将不胜感激。谢谢。
发布于 2018-01-03 11:32:39
我也有这个问题。然后我发现我在文档中遗漏了两个步骤。
首先,记得在plist文件中添加权限。
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Your message to user when the photo library is accessed for the first time</string>
<key>NSMicrophoneUsageDescription</key>然后记得在你的podfile中添加依赖项。
pod 'react-native-camera', :path => '../node_modules/react-native-camera'然后运行pod install。
对我来说,在完成这两个步骤后,它就可以工作了。如果它仍然不起作用,请检查是否正确地链接了库。
希望能有所帮助。
https://stackoverflow.com/questions/41645340
复制相似问题