Hector-Chong / native-wechat

A React Native library for supporting Wechat APIs on Android and iOS
https://native-wechat.hector.im
MIT License
133 stars 11 forks source link

请问下大佬,安装这个库之后ios无法启动,有如下报错 #9

Closed kaeldxy closed 1 year ago

kaeldxy commented 1 year ago

Undefined symbols for architecture x86_64: "_OBJCCLASS$_RCTBridge", referenced from: objc-class-ref in AppDelegate.o "_OBJCCLASS$_RCTBundleURLProvider", referenced from: objc-class-ref in AppDelegate.o "_RCTAppSetupDefaultRootView", referenced from: -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o "_RCTAppSetupPrepareApp", referenced from: -[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

kaeldxy commented 1 year ago

我的mac是M1芯片的,跟这个有关系吗

Hector-Chong commented 1 year ago

这似乎和你的电脑是有关系的,因为使用了和 ARM 架构(M1)不同的 x86 implement 编译 C++ 代码。

如果方便的话,请如下图所示,提供对应 Target 的 Architecture 部分截图,或在 Build Settings 里搜索 x86 相关字样。

image
kaeldxy commented 1 year ago

image 大佬请看,我之前尝试过修改这些值,但不起作用,我之前也在网上看到有人说可能是有的静态库不支持编译到模拟器,但不知道怎么去修改

kaeldxy commented 1 year ago

image 这是搜索 x86 的结果

Hector-Chong commented 1 year ago

你可尝试将 i386 修改为 arm64

image

另外亦可尝试将 C++ Language Dialect 设置为 C++17

image
kaeldxy commented 1 year ago

好的,感谢大佬,🙏