RN开发iOS项目编译报错:Undefined symbols for architecture armv7

RN开发iOS项目编译报错

  • 主要报错信息:
Undefined symbols for architecture armv7:
  "FlipperState::start(std::__1::basic_string, std::__1::allocator >)", 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, std::__1::allocator > const&)", referenced from:
      -[FlipperClient pluginWithIdentifier:] in libFlipperKit.a(FlipperClient.o)
  "facebook::flipper::FlipperClient::performAndReportError(std::__1::function 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)", referenced from:
      -[FlipperClient subscribeForUpdates:] in libFlipperKit.a(FlipperClient.o)
  "facebook::flipper::FlipperClient::removePlugin(std::__1::shared_ptr)", referenced from:
      -[FlipperClient removePlugin:] in libFlipperKit.a(FlipperClient.o)
  "facebook::flipper::FlipperClient::addPlugin(std::__1::shared_ptr)", 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, std::__1::allocator >)
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, std::__1::allocator > const&)
Undefined symbol: facebook::flipper::FlipperClient::performAndReportError(std::__1::function const&)
Undefined symbol: facebook::flipper::FlipperClient::init(facebook::flipper::FlipperInitConfig)
Undefined symbol: FlipperStep::complete()
Undefined symbol: facebook::flipper::FlipperClient::setStateListener(std::__1::shared_ptr)
Undefined symbol: facebook::flipper::FlipperClient::removePlugin(std::__1::shared_ptr)
Undefined symbol: facebook::flipper::FlipperClient::addPlugin(std::__1::shared_ptr)
Undefined symbol: facebook::flipper::FlipperClient::refreshPlugins()
  • 原因分析:在编译运行时,我们可以选择模拟器、真机和Any iOS Device(armv7,arm64);报错的原因应该是编译时使用了Any iOS Device(armv7,arm64),而使用的三方库不支持armv7架构
  • 解决办法:使用真机或模拟器编译运行即可

参考文章:

  • Apple移动设备处理器指令集 armv6、armv7、armv7s及arm64
  • iPhone CPU架构
  • iOS Undefined symbols for architecture armv7

你可能感兴趣的:(RN开发iOS项目编译报错:Undefined symbols for architecture armv7)