之前用的非m1的电脑,xcode版本和系统版本比较老,运行项目没有什么问题。
最近新弄了个电脑 m1,系统是最新的 Monterey 12.2.1,xcode版本是13.2.1。想在模拟器运行项目报错,真机运行正常
ld: in /Users/zhangyu/web/yongliu/cmv-app-rf/node_modules/react-native-wechat-lib/ios/libWeChatSDK.a(WechatAuthSDK.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/zhangyu/web/yongliu/cmv-app-rf/node_modules/react-native-wechat-lib/ios/libWeChatSDK.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/8343fdbffb0056b5.webp)
按照网上说法,加上:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/d942b7ec373849c3.webp)
重新打包后又报错:
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/0a0ce631ec450943.webp)
我找到了这个文件,说这里的 ARCHS[@]
未绑定变量。
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/6c257b6ba227cc3e.webp)
接下来我就不知道该怎么搞了,然后我去命令行执行了 yarn ios
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/fb32005f2115b419.webp)
![在这里插入图片描述](https://img.php1.cn/3cd4a/9b0d/ae9/2d998ad7838fbf16.jpeg)
objc[6618]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x21a98b678) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1065f82c8). One of the two will be used. Which one is undefined.
objc[6618]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x21a98b6c8) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1065f8318). One of the two will be used. Which one is undefined.
** BUILD FAILED **
这里网上说是缓存,我就执行了 rm -rf node_modules && yarn cache clean && yarn install && yarn ios
发现没用,所以我怀疑是 pod 的缓存,于是执行 yarn clean
![在这里插入图片描述](https://img.php1.cn/3cd4a/1eebe/cd5/d67981797265d9c7.webp)
清除后重新执行 pod install
,然后 yarn ios
好像也没用