react本机iOS新方案错误:未定义的符号:_OBJC_CLASS_$_FlipperClient



我在xcode中向我的react原生项目添加了一个新的构建配置Dev.Debug,复制了现有的Debug配置,还为新配置添加了相应的方案。

现在,当我试图用新方案运行项目时,我得到了错误:

Undefined symbol: _OBJC_CLASS_$_FlipperClient

运行我复制的方案效果良好——应用程序安装、启动和功能正常。

添加新的调试方案后是否需要更多的配置?

我发现我需要如下修改我的podfile:

...
target 'MyApp' do
config = use_native_modules!

# Add the project and build configurations
project 'MyApp',
'Dev.Debug' => :debug, # '{Build Configuration name}' => :{debug or release}
'Debug' => :debug,
'Dev.Release' => :release,
'Release' => :release
...
use_flipper!({'Flipper' => '0.126.0', configurations: ['Debug', 'Dev.Debug']}) # Add the Build Configuration name (not scheme name)
...

在我的案例中,我更新到react native: 0.70.*,Flipper更新到174版本,但出现了此错误。将Flipper降级到163为我解决了这个问题。

更多信息请点击此处:https://github.com/facebook/flipper/issues/4278

在React Native的最新版本中,AppDelegate.mmRCTAppSetupPrepareApp(application);替换了传统的Flipper初始化代码,而我忘记了这样做。这给我带来了问题。修复它解决了问题。看见https://react-native-community.github.io/upgrade-helper/对于diffs。

最新更新