I’m encountering build errors with Expo’s EAS Build service. Some of my Swift pods, including FirebaseCoreInternal, FirebaseCrashlytics, FirebaseFirestore, FirebaseSessions, and FirebaseStorage, are not defining modules, which is causing the build to fail. The error messages suggest setting use_modular_headers! in my Podfile, but since I’m using EAS Build, I don’t have direct access to the Podfile. I’m also seeing an error related to , which suggests a problem with my Xcode project file.
Can anyone help resolve these issues? Bests.
[!] 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.
For the first error, I tried fixing react native dependencies and even adding use_modular_headers! to the Podfile using a command in a eas-build-pre-install.yml file, but it didn’t resolve the issue.
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
2
Answers
Ok, I managed to fix the issue with some patience and trial & error. The error is linked to firebase dependencies not being compatible with one another. Expo can use React Native Firebase or Firebase JS SDK. You should only use one when creating a build through EAS. Uninstall one (usually RN Firebase) and adapt your code. Additionally, I installed "expo-build-properties" to set the "modular_headers" to true, as my log was mentioning something with modular headers. I've seen a few other people mentioning such an error online, but with no clear response. I hope this helps anyone stuck with this mysterious error log.
Had a similar issue, specifically building react native expo and adding firebase auth integration
https://github.com/invertase/react-native-firebase/blob/main/docs/index.md#altering-cocoapods-to-use-frameworks
Install dependencies
npx expo install @react-native-firebase/app
npx expo install @react-native-firebase/auth
npx expo install @react-native-firebase/crashlytics
Had to add this to app.json
and
Need the GoogleService-Info.plist generated by fireabse and for some reason
Have to enable google authentication in order to have a REVERSE_CLIENT_ID field… seems like a bug but thats what they have for now
https://github.com/invertase/react-native-firebase/issues/7338