Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning #438

Open
fmss7 opened this issue Jan 5, 2018 · 54 comments
Open

UnhandledPromiseRejectionWarning #438

fmss7 opened this issue Jan 5, 2018 · 54 comments

Comments

@fmss7
Copy link

fmss7 commented Jan 5, 2018

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
Copy link

LucasBSC commented Jan 7, 2018

Same problem here!

@nir-krevner
Copy link

same here

@Shreewebs
Copy link

Shreewebs commented Jan 8, 2018

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

@himalaya-ahuja
Copy link

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

@nir-krevner
Copy link

@Shreewebs , which version works for you ?

@Shreewebs
Copy link

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

@himalaya-ahuja
Copy link

himalaya-ahuja commented Jan 8, 2018 via email

@LucasBSC
Copy link

LucasBSC commented Jan 8, 2018

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

"ionic cordova platform add [email protected]"

It builds then for me.

@fmss7
Copy link
Author

fmss7 commented Jan 8, 2018

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

@fmss7
Copy link
Author

fmss7 commented Jan 8, 2018

@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
Copy link

himalaya-ahuja commented Jan 8, 2018 via email

@LucasBSC
Copy link

LucasBSC commented Jan 8, 2018

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

@nir-krevner
Copy link

that doesn't work for me.

@nir-krevner
Copy link

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

@fmss7
Copy link
Author

fmss7 commented Jan 8, 2018

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

  • That plugin is in beta version (cordova-plugin-firebase)
  • Android platform isn't updated (v6.4.0)
  • What if anyone doesn't want to use Firebase?

Anyways, thank you very much @nir-krevner.

@mathewamg33
Copy link

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

@rcluan
Copy link

rcluan commented Jan 9, 2018

@mathewamg33 downgrading to [email protected] seems to work (check issue #435 ) on Android

@b-d-m-p
Copy link

b-d-m-p commented Jan 11, 2018

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 [email protected].

@fmss7
Copy link
Author

fmss7 commented Jan 11, 2018

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
Copy link

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

@sosamv
Copy link

sosamv commented Jan 14, 2018

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

@selvin007
Copy link

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

@LucasBSC
Copy link

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
Copy link

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

@hanifmazlan
Copy link

hanifmazlan commented Jan 23, 2018

guys.. i still got same error using this method sudo npm uninstall -g cordova then install it back sudo npm install -g [email protected]. 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
Copy link

ionic cordova platform add [email protected] is working for me too.

@tyl3r
Copy link

tyl3r commented Feb 4, 2018

ionic cordova platform add [email protected] was the solution for me too, thanks!.

@AdGARAY
Copy link

AdGARAY commented Feb 6, 2018

I have the same problem but ionic cordova platform add [email protected] is not work

@Yogesh1994
Copy link

ionic cordova platform add [email protected] is not work

@maruthu70
Copy link

maruthu70 commented Feb 8, 2018

same here:(
(node:12164) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to fetch platform [email protected]

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

@sachith-aogroup
Copy link

Was able to generate an APK after downgrading to [email protected]

@rjf26
Copy link

rjf26 commented Feb 15, 2018

ionic cordova platform remove android
ionic cordova platform add [email protected]

@zahiruldu
Copy link

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
Copy link
Author

fmss7 commented Feb 16, 2018

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

@jordanpurinton
Copy link

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

@erperejildo
Copy link

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

@linaashaji
Copy link

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 [email protected]" instead of "cordova platform add android" and it should works fine .

@hernandck
Copy link

1- ionic cordova platform rm android
2- ionic cordova platform add [email protected]

the solution for me, thanks!.

@wangta69
Copy link

wangta69 commented Mar 21, 2018

1- ionic cordova platform rm android
2- ionic cordova platform add [email protected]

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
Copy link

download again Google-services.json file

@lallen30
Copy link

lallen30 commented Apr 5, 2018

What version of jdk should be used?

@hkbenchan
Copy link

This pull request should fix the problem
#461

@lacasera
Copy link

@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
Copy link

@rjf26 's solution worked for me too.

@remarcbalisi
Copy link

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

@DgarciarDev
Copy link

@rjf26 's solution worked for me too.

@IngJavierR
Copy link

Try using cordova 7.1.0 and android 6.4.0

npm install -g [email protected]
ionic cordova platform remove android
ionic cordova platform add [email protected]

@fptoledo
Copy link

fptoledo commented Jun 3, 2018

Thanks @IngJavierR, it works for me!

@danilocecilia
Copy link

the @LucasBSC solution´s worked for me.

Thanks!

@sqzbx
Copy link

sqzbx commented Jul 11, 2018

ionic cordova platform remove android
ionic cordova platform add [email protected]

This one worked for me :) +1

@water-melon91
Copy link

i add ionic cordova platform add [email protected]
not show error
but ionic cordova run android
this error

**Execution failed for task ':processDebugGoogleServices'.

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.**

@water-melon91
Copy link

i got it

#481 (comment)

thanks

@Bionic31
Copy link

Bionic31 commented Sep 9, 2018

keep on getting the same error over and over again even when I degrade it .... please help this issue has already been a dick to my head since this week, need to set up an android app for a client and I doesn't know java that much and can't use an android studio.

Your help will be appreciated thanks!

@dalejomen
Copy link

good morning,
I have problems with the plugin cordova-plugin-admobpro when I compile my project and generate the apk for android generates it well. but when I install the apk in my cellphone to application does not load the program is closed.

This was working fine until last week as this plugin used it in several apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests