9

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:

enter image description here

I am developing the app in windows.

1
  • 1
    Did Peter's answer help? Or you solved it some other way? Commented Sep 8, 2019 at 21:01

4 Answers 4

21

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");
Sign up to request clarification or add additional context in comments.

1 Comment

just to add, there's one one more on line 88
4

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 !

2 Comments

I am using mac operating system but facing same issue.
same, using mac.
3

Remove iOS platform, it requires a MacOS environment.

ionic cordova platform rm ios

Comments

1

Because when you add plugin it try to install for iOS as well and you are trying it in window pc and xcode not installed on windows.

If you remove ios plaform and try for only android then it will work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.