A wild guess would be that on your side some code logic is executing before the "deviceready" event is emitted and blocks the app. Unfortunately, the provided code sample is not sufficient for us to reproduce the way your app crashes. This code is correct as it sticks to the official sample of the Cordova PushPlugin.
We have a very simple project that works as expected using the code above. You can find it attached. Just enter the project number in the app, import
it in your favorite AppBuilder client and deploy it to your Android device. Once you obtain the token for the device you can test the sending of push notifications from the Android GCM sender client for WIndows
in order to eliminate the server part of the whole process. Just enter your GCM API key for server applications and the token of the device in the text inputs and send a push payload for example: "message" : "hello"
. The notification should be received and dispatched to the app.
Let me know if this works for you and if you have further questions.