cordova-plugin-firebasexで「FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle" not found.」というエラーが出た件

cordova-plugin-firebasexのエラーに五時間取られた件

要するに cordova-plugin-firebasex@9.1.1 ではなく cordova-plugin-firebasex@9.1.1-cliを使いましょうという話

- cordova plugin add cordova-plugin-firebasex
+ cordova plugin add cordova-plugin-firebasex@9.1.1-cli

Macでcordova(iOS・Android)の開発を行なっていた時、Firebaseのプラグインとしてcordova-plugin-firebasexをインストールし、iOSのビルドしようとすると以下のようなエラーに遭遇しました。

PhaseScriptExecution [CP]\ Copy\ Pods\ Resources /Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/HelloCordova-dgfedsqlrhzixbfoazaxhnolmvuk/Build/Intermediates.noindex/ArchiveIntermediates/HelloCordova/IntermediateBuildFilesPath/HelloCordova.build/Debug-iphoneos/HelloCordova.build/Script-77380BD77F1B81B2F6C5D797.sh (in target 'HelloCordova' from project 'HelloCordova')
    cd /Users/xxxxxxxx/cordova-test/com.test/platforms/ios
    /bin/sh -c /Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/HelloCordova-dgfedsqlrhzixbfoazaxhnolmvuk/Build/Intermediates.noindex/ArchiveIntermediates/HelloCordova/IntermediateBuildFilesPath/HelloCordova.build/Debug-iphoneos/HelloCordova.build/Script-77380BD77F1B81B2F6C5D797.sh
error: Resource "/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/HelloCordova-dgfedsqlrhzixbfoazaxhnolmvuk/Build/Intermediates.noindex/ArchiveIntermediates/HelloCordova/BuildProductsPath/Debug-iphoneos/FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle" not found. Run 'pod install' to update the copy resources script.

** ARCHIVE FAILED **

FirebaseInAppMessaging/InAppMessagingDisplayResources.bundle" not found. Run 'pod install' to update the copy resources script.が原因ぽいです。

GitHubに助けられました

Protip: don’t pin it like so:

“cordova-plugin-firebasex”: “^9.1.1-cli”

as it will default to the non-cli. Use it directly.

“cordova-plugin-firebasex”: “9.1.1-cli”

Seems obvious, but I’ve lost some time today scratching my head, why it still throws the old error.

https://github.com/dpa99c/cordova-plugin-firebasex/issues/326#issuecomment-634775777

READMEにも書いてあった😇

https://github.com/dpa99c/cordova-plugin-firebasex#cordova-cli-builds

iOSのビルド長いしエラーわかりにくいし疲れた…


See also