React-Native iOS新方案错误:未定义符号:_OBJC_CLASS_$_FlipperClient。

13
我在我的 react-native 项目中添加了一个名为 Dev.Debug 的新的构建配置,并且复制了现有的 Debug 配置,同时为新的构建配置添加了相应的 scheme。但是当我尝试使用新的 scheme 运行项目时,我遇到了错误:Undefined symbol: _OBJC_CLASS_$_FlipperClient。使用我复制的 scheme 运行可以正常工作-应用程序安装、启动并正常运行。是否需要在添加新的 Debug scheme 后进行其他配置?
6个回答

7

我发现需要按如下方式修改我的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)

...

我花了8个小时的时间搜索,最终找到了解决方法。感谢!最终我没有声明翻转器版本,所以我的代码看起来像这样:use_flipper!({ configurations: ['Debug', 'Dev.Debug'] }) - seedBoot

5

2
在最近的 React Native 版本中,AppDelegate.mmRCTAppSetupPrepareApp(application); 替换了旧的 Flipper 初始化代码,我忘记进行替换。这导致了我的问题。修复后问题解决。请参考https://react-native-community.github.io/upgrade-helper/以查看差异。

1
我从以下版本降级:
-    "react-native-flipper": "^0.212.0",
+    "react-native-flipper": "^0.164.0",

现在对我来说,debugarchive都可以正常工作了。

0
在我的情况下,这个问题通过安装正确版本的`react-native-flipper` npm包得到解决。
我在`Podfile.lock`和`gradle.properties`中看到二进制Flipper版本是0.125.0,所以我使用了`yarn add react-native-flipper@0.125.0`而不是默认版本,现在我可以重新构建了 :)

禁用翻转器可以简单地解决问题吗?当我使用较旧版本的react-native-svg时,遇到了这个错误。 - undefined

-1
将XCode的构建配置从Release更改为Debug,为我修复这个错误。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接