gpt4 book ai didi

ios - 无法编译 React Native iOS 应用程序以在物理设备上运行,React Native Firebase 出现问题

转载 作者:行者123 更新时间:2023-12-01 15:16:11 24 4
gpt4 key购买 nike

由于最近的某些原因,我无法从 Xcode 甚至从命令行在物理设备上运行我的 React Native 应用程序。我收到以下错误:

duplicate symbol '_md5_block_data_order' in:
/XXX/Library/Developer/Xcode/DerivedData/XXXX-bdrylwsxpcqgzvgkcljteyttcdmr/Build/Products/Debug-iphoneos/BoringSSL-GRPC/libBoringSSL-GRPC.a(md5.o)
/XXX/project/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(md5_dgst.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

但是它在模拟器上运行良好。我可以毫无问题地将应用程序上传到 AppStoreConnect。

据我了解,两个库中似乎存在相同的符号。不知道为什么,很可能是移动应用程序依赖项之一。

在安装的 Pod 列表中,我有两个 BoringSSL-GRPC (0.0.3)OpenSSL-Universal (1.0.2.19)
Firebase 使用 BoringSSL,Flipper 使用 OpenSSL。

这是我使用的第三方依赖项列表:
  pod 'Firebase/Core', '~> 6.3.0'

pod 'Firebase/Messaging', '~> 6.3.0'

pod 'Firebase/Firestore', '~> 6.3.0'

pod 'Firebase/Auth', '~> 6.3.0'

pod 'TrustKit'

pod 'Stripe', '16.0.0'

pod 'Amplitude-iOS', '~> 4.5'

pod 'Intercom', '~> 5.5.1'

flipper_pods()


当我一起删除 Firebase 时,它​​工作正常,我可以在设备上运行我的应用程序。但我需要火力基地...

知道如何解决这个问题吗?

谢谢!

最佳答案

这是其他人也注意到的问题https://github.com/invertase/react-native-firebase/issues/3384

最常见的症状如下:

Pods/OpenSSL-Universal/ios/lib/libcrypto.a(bio_lib.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

这里记录了一个上游问题 https://github.com/facebook/flipper/issues/485在很明显这将是一个比预期更大的问题之前就关闭了。

我测试了一种解决方法,该解决方法目前不是最佳但可以使用,直到在传递依赖项中提供带有位码的 OpenSSL 库 - 解决方法是
  • 禁用用于开发的位码(即存在 Flipper 的地方)
  • 确保您在任何地方都打开了死代码剥离
  • 为 Release模式启用位码

  • 以我的经验,这适用于本地设备上的调试构建(之前失败),并且 Release模式下的 TestFlight 构建有效

    希望这可以帮助!

    关于ios - 无法编译 React Native iOS 应用程序以在物理设备上运行,React Native Firebase 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60007014/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com