Even I was facing the similar issue, I tried updating Cordova, Ionic and setting ANDROID_HOME and JAVA_HOME and almost all the solution over the web, but nothing worked for me. Finally, it was the issue with PhoneGap-push plugin. The 2.0 version of PhoneGap-push plugin has some collision with some plugins like
Google Analytics
To be more specific the plugins that use google play services.
So Below is my solution.
- First, remove the PhoneGap-push plugin 2.0 from your application.
- Now try to build the app by commenting all the lines that use push plugin.
- If the build is successful then it will be the issue with push plugin. Then follow below instructions to fix the issue. If the build is not successful then you might be having some other issue.
- First, uninstall the PhoneGap-push plugin 2.0
- Then go to project -> package.json and search for push and replace the line with “”: “4.0.1” earlier it will be 4.3.0 or 4.3.1
- Now add push plugin again to the project with below command ionic plugin add [email protected] --variable SENDER_ID=XXXXXXX
- Now build your app works like a charm....
This issue is already opened in phonegap-pushplugin repo . They have a next milestone of releasing version 2.1.0 which will be fixing this issue.