react-native 开发问题总结

1,565 阅读1分钟

1. The file “Images.xcassets” couldn’t be opened because you don’t have permission to view it.

需要清理缓存comman+shift+k or xcode > Product > Clean Build folder

2. This iPhone 5s (Model A1457, A1518, A1528, A1530) is running iOS 12.4.3 (16G130), which may not be supported by this version of Xcode.

调试的真机系统版本高于xcode所支持的最高版本,需要下载xcode支持包,或者升级xcode;

支持包地址

3.Library not loaded: @rpath/QBImagePicker.framework/QBImagePicker

Library not loaded: @rpath/QBImagePicker.framework/QBImagePicker
xxxxxxxx
Reason: image not found`

react-native-image-crop-picker缺少库支持,解决方法

xcode > General > Deployment Target to 8.0
xcode > General > Embedded Binaries > + RSKImageCropper.framework and QBImagePicker.framework

4.Error:fseventsunavailable (this watcher can only be used on Darwin)

npm r -g watchman
brew install watchman

// or

npm r -g watchman
npm install -g watchman

5.xcode 报错 linker command failed with exit code 1 (use -v to see invocation)

我遇到的问题是因为我的项目引入了codepush,引用的一个第三方模块也引用了codepush导致的重复引用

iphonesimulator/libCodePush.a(aeskey.o)
2 duplicate symbols for architecture x86_64 // 重复引用了某个模块
linker command failed with exit code 1 (use -v to see invocation)

6.Invariant Violation: Invariant Violation: requireNativeComponent: "RNSVGLinearGradient" was not foun

我是在使用 react-native-linear-gradient 时遇到的这个问题,同样的问题可能出现在 react-native-svg

从 node_modules 中的 react-native-linear-gradient 下选择 BVLinearGradient.xcodeproj 添加到项目

// 添加方式
xcode > 'You Priject' > Libraries > Add Files to 'You Priject' 
xcode > Build Phases > Link Binary With Libraries > add `libBVLinearGradient.a`