fechanique / cordova-plugin-fcm

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

UnhandledPromiseRejectionWarning #438

Open fmss7 opened 6 years ago

fmss7 commented 6 years ago

I'm trying to run my Ionic app in an Android device with cordova-plugin-fcm but I get the error below when I try to install it (cordova plugin add cordova-plugin-fcm) or run it (ionic cordova run android).

(node:2360) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Invalid data, chunk must be a string or buffer, not object (node:2360) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thanks.

LucasBSC commented 6 years ago

Same problem here!

nir-krevner commented 6 years ago

same here

Shreewebs commented 6 years ago

Same here!! :( Problem since 1st Jan 2018. Only in new installation of FCM plugin. Old works good.

himalaya-ahuja commented 6 years ago

Can someone look into this ???? facing the same issue..

nir-krevner commented 6 years ago

@Shreewebs , which version works for you ?

Shreewebs commented 6 years ago

@nir-krevner ; Old Deployed projects with FCM are working good.

himalaya-ahuja commented 6 years ago

@Shreewebs which version of fcm plugin works for you?

On Mon, Jan 8, 2018 at 2:35 PM, Shreewebs notifications@github.com wrote:

@nir-krevner https://github.com/nir-krevner ; Old Deployed projects with FCM are working good.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fechanique/cordova-plugin-fcm/issues/438#issuecomment-355912989, or mute the thread https://github.com/notifications/unsubscribe-auth/AegRNWLWt7TT-pHC0JMhBHW3peMkD2oBks5tIdptgaJpZM4RUhpc .

-- Regards, Himalaya Ahuja

Himalaya|Android Developer | +91 9013451085 | www.iffort.com

LucasBSC commented 6 years ago

It works for me with Android platform 6.4.0. Remove the platform and then go for

"ionic cordova platform add android@6.4.0"

It builds then for me.

fmss7 commented 6 years ago

@Shreewebs How can anyone install an old version of the plugin? With cordova plugin add cordova-plugin-fcm@latestVersionThatWorks ?

fmss7 commented 6 years ago

@LucasBSC have you tried to run the app in an Android device? It crash for me when Android platform is 6.4.0

himalaya-ahuja commented 6 years ago

Please let us know asap if anyone finds a solution to this..!!

On Mon, Jan 8, 2018 at 3:51 PM, fmss7 notifications@github.com wrote:

@LucasBSC https://github.com/lucasbsc have you try to run the app in an Android device? It crash for me when Android platform is 6.4.0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fechanique/cordova-plugin-fcm/issues/438#issuecomment-355928617, or mute the thread https://github.com/notifications/unsubscribe-auth/AegRNcpVX8TtZTqWZrbTHdtFGEOjy9nHks5tIewzgaJpZM4RUhpc .

-- Regards, Himalaya Ahuja

Himalaya|Android Developer | +91 9013451085 | www.iffort.com

LucasBSC commented 6 years ago

@fmss7 Yes, It worked for me. I built an APK and installed it on my Android device normally

nir-krevner commented 6 years ago

that doesn't work for me.

nir-krevner commented 6 years ago

I've installed the second fcm plugin and it works with android 6.4.0 https://www.npmjs.com/package/cordova-plugin-firebase

fmss7 commented 6 years ago

I've done it and it works for me too, but the facts are:

Anyways, thank you very much @nir-krevner.

mathewamg33 commented 6 years ago

Same problem here with the latest version of FCM plugin!!

rcluan commented 6 years ago

@mathewamg33 downgrading to cordova@7.1.0 seems to work (check issue #435 ) on Android

b-d-m-p commented 6 years ago

Yup, @rcluan is correct. I just upgraded with sudo npm install -g cordova@latest to 8.0.0 and then I get the error. Goes away by doing sudo npm install -g cordova@7.1.0.

fmss7 commented 6 years ago

Thanks for your answers guys! Even though in my opinion those fixes should be temporary because we should be able to work with the updated versions. Hope someone fix it in the end.

mburger81 commented 6 years ago

This is same error as the error I opened before #436 the problem should be not global installed cordova but cordova-android

sosamv commented 6 years ago

Guys, I had to uninstall the android platform and installed the @6.x.x and worked! :)

selvin007 commented 6 years ago

Not compatible with cordova 7 & 8, cordova 6 is obsolete for windows plugin is useless in current form

LucasBSC commented 6 years ago

I have Cordova 8.0.0. It works fine but with Android platform 6.4.0 as mentioned above. I had before conflict issues with Google Maps plugin but figured this out on another Issue here in the repo. Good luck!

mburger81 commented 6 years ago

@selvin007 cordova 7 & 8 schould work fine, the problem should be the cordova-android plugin and not cordova

hanifmazlan commented 6 years ago

guys.. i still got same error using this method sudo npm uninstall -g cordova then install it back sudo npm install -g cordova@7.1.0. when i check cordova -v it wrote 7.1.0 but in ionic info here it give

`cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 6.3.0 browser 5.0.3 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v8.9.4
npm  : 5.6.0
OS   : macOS High Sierra

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro`

and error run cordova

(node:6964) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot find module '../cordova/platform_metadata' (node:6964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

bitterdev commented 6 years ago

ionic cordova platform add android@6.4.0 is working for me too.

tyl3r commented 6 years ago

ionic cordova platform add android@6.4.0 was the solution for me too, thanks!.

AdGARAY commented 6 years ago

I have the same problem but ionic cordova platform add android@6.4.0 is not work

Yogesh1994 commented 6 years ago

ionic cordova platform add android@6.4.0 is not work

maruthu70 commented 6 years ago

same here:( (node:12164) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to fetch platform cordova-android@6.4.0

Cordova version 8.0.0. tried to downgrade 7.1.0 and 6.4.0 --- but same.

sachith-aogroup commented 6 years ago

Was able to generate an APK after downgrading to android@6.4.0

rjf26 commented 6 years ago

ionic cordova platform remove android ionic cordova platform add android@6.3.0

zahiruldu commented 6 years ago

Use full path to your sdk folder with environment variable after downgrading the versions. change your path: sudo ANDROID_HOME="/home/zahirul/android-sdk-linux" cordova build --release android

fmss7 commented 6 years ago

Why do you suppose we're working on Linux based system @zahiruldu ???

jordanpurinton commented 6 years ago

Are there any plans to upgrade this plugin to suupport cordova-android 7.0+ @fechanique ?

erperejildo commented 6 years ago

I'm trying solutions above but none of them work to me

linaashaji commented 6 years ago

It works on cordova 8.0.0 ,but you have to change your cordova-android version : When you add your android platforms, type "cordova platform add android@6.4" instead of "cordova platform add android" and it should works fine .

hernandck commented 6 years ago

1- ionic cordova platform rm android 2- ionic cordova platform add android@6.4.0

the solution for me, thanks!.

wangta69 commented 6 years ago

1- ionic cordova platform rm android 2- ionic cordova platform add android@6.4.0

after above step I got this error Please fix the version conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 9.0.0

After removing cordova-plugin-admobpro it work. This conflict with admobpro!

my version

cordova --version : 8.0.0 cordova platform version android : 6.4.0

hernandck commented 6 years ago

download again Google-services.json file

lallen30 commented 6 years ago

What version of jdk should be used?

hkbenchan commented 6 years ago

This pull request should fix the problem https://github.com/fechanique/cordova-plugin-fcm/pull/461

lacasera commented 6 years ago

@rjf26 's solution works. and also make sure the package_name in your google-services.json file matches the id in your config.xml file

danilocecilia commented 6 years ago

@rjf26 's solution worked for me too.

remarcbalisi commented 6 years ago

Maybe open terminal and run as admin then ionic cordova platform add and it will ask for your platform, type your desired platform

DgarciarDev commented 6 years ago

@rjf26 's solution worked for me too.

IngJavierR commented 6 years ago

Try using cordova 7.1.0 and android 6.4.0

npm install -g cordova@7.1.0 ionic cordova platform remove android ionic cordova platform add android@6.4.0

fptoledo commented 6 years ago

Thanks @IngJavierR, it works for me!

danilocecilia commented 6 years ago

the @LucasBSC solution´s worked for me.

Thanks!

sqzbx commented 5 years ago

ionic cordova platform remove android ionic cordova platform add android@6.4.0

This one worked for me :) +1