fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
624 stars 991 forks source link

Simple "cordova plugin add" not working #638

Open R-obert opened 4 years ago

R-obert commented 4 years ago

Documentation says in order to add the plugin I should do the following:

$ cordova plugin add cordova-plugin-fcm
Installing "cordova-plugin-fcm" for android
Subproject Path: CordovaLib
Subproject Path: app

        Cordova FCM plugin v2.1.2 installed
        For more details visit https://github.com/fechanique/cordova-plugin-fcm

Adding cordova-plugin-fcm to package.json
The "chunk" argument must be of type string or an instance of Buffer. Received an instance of Error

This breaks cordova build android, the only output it shows is that "chunk" argument message.

furkan6116 commented 3 years ago

dude ı'm also getting that error. did you fixed it ?

mike-nelson commented 3 years ago

Hi, yes there is a fix for this. It is just a couple of lines of code.

See https://github.com/fechanique/cordova-plugin-fcm/issues/501

I have forked and updated the problematic file. Feel free to use this one: https://github.com/mike-nelson/cordova-plugin-fcm.git

cordova plugin add https://github.com/mike-nelson/cordova-plugin-fcm.git

However, this didn't get me far, and I got the next error: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled

Which can be fixed using this: cordova plugin add cordova-plugin-androidx-adapter