RN에 파이어베이스연동시 발생하는 ios 에러

김보람's avatar
Jan 02, 2024
RN에 파이어베이스연동시 발생하는 ios 에러

[ 상황 ]

파이어베이스 애널리틱스 연결을 위해 @react-native-firebase/app, @react-native-firebase/analytics를 다운받고 pod install을 시도했더니 아래와같은 에러가 발생


[ 내용 ]

[!] 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.

Swift로 작성된 FirebaseCoreInternal은 GoogleUtilities에 의존하고있는데 GoogleUtilities가 모듈을 정의하지 않았다는 내용이고,
use_modular_headers! 또는 :modular_headers => true의 해결 방법을 제시하고있다.


[ 해결방법 ]

  1. use_modular_headers!

    → Podfile의 상단에 use_modular_headers!를 추가하여 모든 라이브러리를 모듈 방식으로 처리하도록 설정하는 방법

  2. :modular_headers => true

    → 특정 라이브러리를 모듈방식으로 처리


[ 채택 방법 ]

해결방법의 2번, 아래와 같이 Pidfile.mm에 특정 라이브러리를 모듈화하는 방식으로 처리했다.

target 'project' do 
  ... 
  pod 'FirebaseCore', :modular_headers => true  #추가
  pod 'GoogleUtilities', :modular_headers => true #추가

이유는 일괄처리하게 되면 어떤 잠재적 영향이 있을지 판단이 서지 않기 때문에 개별로 처리했다

Share article

b0-0d