I am trying to perform phone authentication
using firebase
in my app(ionic V-4).After creating the app, I just added the android/ios
platforms using the below commands:
ionic cordova platform add android
ionic cordova platform add ios
Then tried to install firebase plugin like this:
ionic cordova plugin add cordova-plugin-firebase
It is throwing this error:
I am developing the app in windows
.
You are using cordova 9, and in that version requireCordovaModule
was deprecated for non cordova modules and thats why you get the following error.
You need to navigate to the following js file in your environment:
https://github.com/arnesson/cordova-plugin-firebase/blob/master/scripts/ios/helper.js#L33
and change:
var xcode = context.requireCordovaModule("xcode");
into this ( since xcode is an npm package):
var xcode = require("xcode");
Actually, your are working on Windows
and you added an iOS platform.
This is not working.
Remove the iOS platform :
ionic cordova platform rm ios
Then try to install firebase by doing the command below :
ionic cordova plugin add cordova-plugin-firebase
npm install @ionic-native/firebase
Good luck !
Remove iOS platform, it requires a MacOS environment.
ionic cordova platform rm ios
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With