使用 Expo EAS 构建的 iOS 构建失败。我如何解决 <PBXResourcesBuildPhase UUID=...> 和 pod 未定义模块的问题?

问题描述 投票:0回答:1

我在使用 Expo 的 EAS 构建服务时遇到构建错误。我的一些 Swift pod(包括 FirebaseCoreInternal、FirebaseCrashlytics、FirebaseFirestore、FirebaseSessions 和 FirebaseStorage)未定义模块,这导致构建失败。错误消息建议设置 use_modular_headers!在我的 Podfile 中,但由于我使用的是 EAS Build,所以我无法直接访问 Podfile。我还看到与 相关的错误,这表明我的 Xcode 项目文件存在问题。

任何人都可以帮助解决这些问题吗?最好的。

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
The Swift pod `FirebaseCrashlytics` depends upon `FirebaseCore`, `FirebaseInstallations`, `GoogleDataTransport`, `GoogleUtilities`, and `nanopb`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
The Swift pod `FirebaseFirestore` depends upon `FirebaseCore`, `FirebaseCoreExtension`, and `FirebaseFirestoreInternal`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
The Swift pod `FirebaseSessions` depends upon `FirebaseCore`, `FirebaseCoreExtension`, `FirebaseInstallations`, `GoogleDataTransport`, `GoogleUtilities`, and `nanopb`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
The Swift pod `FirebaseStorage` depends upon `FirebaseAppCheckInterop`, `FirebaseAuthInterop`, `FirebaseCore`, `FirebaseCoreExtension`, and `GTMSessionFetcher`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
[!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `4C884446293545CF961CD81F` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Error: Unknown error. See logs of the Install pods build phase for more information.

对于第一个错误,我尝试修复 React Native 依赖项,甚至添加 use_modular_headers!使用 eas-build-pre-install.yml 文件中的命令添加到 Podfile,但它没有解决问题。

version: 0.1
beforeCommit:
  - command: echo "postinstall: expo prebuild && sed -i -e 's/use_native_modules!/use_native_modules!\\nuse_modular_headers!/' ios/Podfile" >> package.json
    type: shell
react-native expo cocoapods eas
1个回答
0
投票

好的,我通过一些耐心和反复试验成功解决了这个问题。该错误与 firebase 依赖项彼此不兼容有关。 Expo可以使用React Native Firebase或Firebase JS SDK。通过 EAS 创建构建时,您应该只使用一个。卸载一个(通常是 RN Firebase)并调整您的代码。此外,我安装了“expo-build-properties”以将“modular_headers”设置为 true,因为我的日志提到了带有模块化标头的内容。我在网上看到其他一些人提到了这样的错误,但没有明确的回应。我希望这可以帮助任何陷入这个神秘错误日志的人。

© www.soinside.com 2019 - 2024. All rights reserved.