【react-native】Undefined symbols for architecture x86_64

出现这种情况,多半是你添加了一个新的第三方库,结果不兼容,或者编译失败了,然后使用

yarn remove xxx 移除卸载后 同样不行,重新安装pod呢,也是有问题。

建议:

1.rm -rf node_modules

2.cd ios && rm -rf Podfile.lock Pods

3.移除derivedData文件,这个是xcode编译缓存文件夹

4.pod install

5.cd ../ && npm install

6.xcode打开项目编译

如果还不行:重新init新的项目后,复制代码过去吧。