CocoaPodsExpo bareFirebase

The Swift pod `FirebaseCoreInternal` depends upon `GoogleUtilities`, which does not define modules. エラーを修正する方法

use_frameworks-01-1 CocoaPods
スポンサーリンク

開発環境

  • expo: 49.0.13 (bare)
  • @react-native-firebase/app: 18.5.0

エラーメッセージ

cd ios/ && pod install コマンドを実装して失敗すると下記のようになります。

try🐶everything myproject$ npx pod-install
....
Installing RecaptchaInterop (100.0.0)
[!] 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.
Couldn't install Pods. Updating the Pods project and trying again...
> pod install --repo-update
Using Expo modules
...

対応

react-native-firebase v15+ 以降では フレームワークを使用するように CocoaPods を変更する必要があるようです。

フレームワークを使用するように CocoaPods を変更する

firebase-ios-sdk v9+ (react-native-firebase v15+) 以降では、フレームワークを使用するように CocoaPods に指示する必要があります。

ファイル ./ios/Podfile を開き、次の行をターゲット内に追加します (ネイティブ モジュール構成を取得するために、反応ネイティブ Podfile 関数を呼び出す行の直後)。

https://rnfirebase.io/#altering-cocoapods-to-use-frameworksの内容を機械翻訳

実際に⬆︎の内容を反映し問題無くビルドした ios/Podfile の中身 (⬇︎) をご参考ください。

ビルドします。

# Android apps
npx react-native run-android

# iOS apps
cd ios/
pod install --repo-update
cd ..
npx react-native run-ios

ビルドが成功すれば完了です。

スポンサーリンク

コメント

タイトルとURLをコピーしました