The firebasex Cordova plugin is driving me up the walls! My project has worked fine for months until I updated the cordova-plugin-firebasex from 11.0.3-cli to 14.1.0. This is the error I am getting now after running Cordova platform add ios:
Failed to install 'cordova-plugin-firebasex': Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/mmhayes/Documents/MyQCWeb/MyQC_v6_7/node_modules/cordova-common/src/superspawn.js:136:25)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
My environment:
Cordova -v
11.0.0
Cordova platform ls
Installed platforms:
ios 6.2.0
Available platforms:
android ^10.1.1
browser ^6.0.0
electron ^3.0.0
osx ^6.0.0
Cordova plugin ls
cordova-plugin-firebase-analytics 6.1.0 "FirebaseAnalyticsPlugin"
cordova-plugin-firebase-dynamiclinks 6.1.3 "FirebaseDynamicLinksPlugin"
cordova-plugin-firebasex 14.1.0 "Google Firebase Plugin"
I believe the issue has something to do with the pod versions but I'm not sure. There isn't much on the web about the "exit code 31" error. What little there was, I tried their suggested solutions with no luck. This included running
Cordova clean
Cordova plugin rm cordova-plugin-firebasex
Cordova plugin add cordova-plugin-firebasex
pod repo update
sudo gem install cocoa pods
I know this goes without saying, but any help is much appreciated! I can provide more info about my environment if it would be helpful.
My project's Podfile:
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
use_frameworks!
target 'My Quickcharge' do
project 'My Quickcharge.xcodeproj'
pod 'Firebase/Analytics', '~> 8.8.0'
pod 'Firebase/DynamicLinks', '~> 8.8.0'
pod 'Firebase/Core', '9.1.0'
pod 'Firebase/Auth', '9.1.0'
pod 'Firebase/Messaging', '9.1.0'
pod 'Firebase/Performance', '9.1.0'
pod 'Firebase/RemoteConfig', '9.1.0'
pod 'Firebase/InAppMessaging', '9.1.0'
pod 'FirebaseFirestore', :tag => '9.1.0', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git'
pod 'Firebase/Crashlytics', '9.1.0'
pod 'Firebase/Functions', '9.1.0'
pod 'Firebase/Installations', '9.1.0'
pod 'GoogleSignIn', '6.2.1'
pod 'GoogleTagManager', '7.4.1'
end
Also, when I try to run pod install --repo-update
I get this error:
pod install --repo-update
Updating local specs repositories
CocoaPods 1.11.3 is available.
To update use: `gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.3
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "Firebase/DynamicLinks":
In Podfile:
Firebase/DynamicLinks (= 6.33.0)
None of your spec sources contain a spec satisfying the dependency: `Firebase/DynamicLinks (= 6.33.0)`.
You have either:
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
For anyone struggling with this same issue, we finally found a solution:
As noted above, the problem appeared to be that the Firebase SDK pod versions, which our two Firebase plugins relied on (cordova-plugin-firebasex
& cordova-plugin-firebase-dynamiclinks
), were out of sync after updating the firebasex plugin.
After much trial and error, we finally aligned the pod versions by installing the right plugin versions and passing the correct IOS_FIREBASE_SDK_VERSION
variables during installation.
We had success by installing cordova-plugin-firebasex@16.0.0
and cordova-plugin-firebase-dynamiclinks@7.0.2
. Both were passed the same IOS_FIREBASE_SDK_VERSION="10.2.0"
variable. Here are the complete plugin installation commands (minus app-specific variables like APP_DOMAIN_PATH
, etc):
cordova plugin install cordova-plugin-firebase-dynamiclinks --variable IOS_FIREBASE_SDK_VERSION="10.2.0"
cordova plugin install cordova-plugin-firebasex --variable IOS_FIREBASE_SDK_VERSION="10.2.0"
After installing the plugins, you can verify the pod versions are all aligned by opening plugins/cordova-plugin-firebasex/plugin.xml
and look for something like this:
<pods use-frameworks="true">
<pod name="Firebase/Core" spec="10.2.0"/>
<pod name="Firebase/Auth" spec="10.2.0"/>
<pod name="Firebase/Messaging" spec="10.2.0"/>
<pod name="Firebase/Performance" spec="10.2.0"/>
<pod name="Firebase/RemoteConfig" spec="10.2.0"/>
<pod name="Firebase/InAppMessaging" spec="10.2.0"/>
<pod name="Firebase/Firestore" spec="10.2.0"/>
<pod name="Firebase/Crashlytics" spec="10.2.0"/>
<pod name="Firebase/Functions" spec="10.2.0"/>
<pod name="Firebase/Installations" spec="10.2.0"/>
<pod name="GoogleSignIn" spec="6.2.4"/>
<pod name="GoogleTagManager" spec="7.4.2"/>
</pods>
We found that after all of the Firebase SDK pod versions were aligned, the builds ran without issue.