RN开发iOS项目编译报错
Undefined symbols for architecture armv7:
"FlipperState::start(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
facebook::flipper::FlipperClient::start()::'lambda'()::operator()() const in libFlipperKit.a(FlipperClient.o)
facebook::flipper::FlipperClient::stop()::'lambda'()::operator()() const in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::instance()", referenced from:
-[FlipperClient init] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::getStateElements()", referenced from:
-[FlipperClient getStateElements] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::getState()", referenced from:
-[FlipperClient getState] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::getPlugin(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
-[FlipperClient pluginWithIdentifier:] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::performAndReportError(std::__1::function<void ()> const&)", referenced from:
facebook::flipper::FlipperClient::start() in libFlipperKit.a(FlipperClient.o)
facebook::flipper::FlipperClient::stop() in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::init(facebook::flipper::FlipperInitConfig)", referenced from:
-[FlipperClient init] in libFlipperKit.a(FlipperClient.o)
"FlipperStep::complete()", referenced from:
facebook::flipper::FlipperClient::start()::'lambda'()::operator()() const in libFlipperKit.a(FlipperClient.o)
facebook::flipper::FlipperClient::stop()::'lambda'()::operator()() const in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::setStateListener(std::__1::shared_ptr<FlipperStateUpdateListener>)", referenced from:
-[FlipperClient subscribeForUpdates:] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::removePlugin(std::__1::shared_ptr<facebook::flipper::FlipperPlugin>)", referenced from:
-[FlipperClient removePlugin:] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::addPlugin(std::__1::shared_ptr<facebook::flipper::FlipperPlugin>)", referenced from:
-[FlipperClient addPlugin:] in libFlipperKit.a(FlipperClient.o)
"facebook::flipper::FlipperClient::refreshPlugins()", referenced from:
-[FlipperClient refreshPlugins] in libFlipperKit.a(FlipperClient.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Undefined symbol: FlipperState::start(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)
Undefined symbol: facebook::flipper::FlipperClient::instance()
Undefined symbol: facebook::flipper::FlipperClient::getStateElements()
Undefined symbol: facebook::flipper::FlipperClient::getState()
Undefined symbol: facebook::flipper::FlipperClient::getPlugin(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
Undefined symbol: facebook::flipper::FlipperClient::performAndReportError(std::__1::function<void ()> const&)
Undefined symbol: facebook::flipper::FlipperClient::init(facebook::flipper::FlipperInitConfig)
Undefined symbol: FlipperStep::complete()
Undefined symbol: facebook::flipper::FlipperClient::setStateListener(std::__1::shared_ptr<FlipperStateUpdateListener>)
Undefined symbol: facebook::flipper::FlipperClient::removePlugin(std::__1::shared_ptr<facebook::flipper::FlipperPlugin>)
Undefined symbol: facebook::flipper::FlipperClient::addPlugin(std::__1::shared_ptr<facebook::flipper::FlipperPlugin>)
Undefined symbol: facebook::flipper::FlipperClient::refreshPlugins()
- 原因分析:在编译运行时,我们可以选择模拟器、真机和
Any iOS Device(armv7,arm64)
;报错的原因应该是编译时使用了Any iOS Device(armv7,arm64)
,而使用的三方库不支持armv7
架构
-
解决办法:使用真机或模拟器编译运行即可
参考文章: