
Expo 환경에서
@react-native-firebase의존성 추가 후 알 수 없는 오류로 인한 빌드 실패 해결
Expo SDK 54
@react-native-firebase/app@^23.8.6
@react-native-firebase/messaging@^23.8.6
Expo React Native 프로젝트에서 Android, iOS Platform의 FCM Push Token을 발급받기 위해 @react-native-firebase 라이브러리를 설치한 이후,
app.config.ts에
...
plugins: [
...
'@react-native-firebase/app',
'@react-native-firebase/messaging',
...
추가한 이후 eas build로 빌드 시 오류 발생
로컬 expo prebuild 시에는 문제 없이 빌드 됨.
Error Log
Build failed: The "Run fastlane" step failed because of an error in the Xcode build process. We automatically detected following errors in your Xcode build logs:
- include of non-modular header inside framework module 'RNFBApp.RCTConvert_FIRApp': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTConvert.h' [-Werror,-Wnon-modular-include-in-framework-module]
- include of non-modular header inside framework module 'RNFBApp.RCTConvert_FIROptions': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTConvert.h' [-Werror,-Wnon-modular-include-in-framework-module]
- include of non-modular header inside framework module 'RNFBApp.RNFBAppModule': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h' [-Werror,-Wnon-modular-include-in-framework-module]
- include of non-modular header inside framework module 'RNFBApp.RNFBRCTEventEmitter': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTEventEmitter.h' [-Werror,-Wnon-modular-include-in-framework-module]
- include of non-modular header inside framework module 'RNFBApp.RNFBSharedUtils': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h' [-Werror,-Wnon-modular-include-in-framework-module]
- include of non-modular header inside framework module 'RNFBApp.RNFBUtilsModule': '/Users/expo/workingdir/build/apps/native/ios/Pods/Headers/Public/React-Core/React/RCTBridgeModule.h' [-Werror,-Wnon-modular-include-in-framework-module]
AI는 buildReactNativeFromSource: true 설정이나, 커스텀 플러그인을 생성해서 ['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'를 설정하는 해결방법을 제시하지만 이렇게는 해결되지 않습니다.
이 문제는 Git Issue에서 알려진 이슈입니다.
app.config.ts에 expo-build-properties 플러그인 설정에서 사용중인 모든Firebase Pod를 forceStaticLinking 배열에 추가합니다.
plugins: [
...
[
'expo-build-properties',
{
ios: {
useFrameworks: 'static',
forceStaticLinking: ['RNFBApp', 'RNFBMessaging', ... ],
},
...