Push Notification Crashed the Ionic 3 App


I have an ionic app with more libraries installed. Then I added Ionic Push Notification library. When push notification received app goes crashed. Then I build a new app and installed Ionic Push Notification library. It worked well.

Next I installed my other libraries. After build, it gave build failed notice with updating the version of com.google.android.gms to 11.6.2. Then I remove Android platform and reinstalled it. Then app was built well.

Next I send push notification again and app goes crashed again. It happened during foreground and background.

What could be the reason?


This is a part of my app level build.gradle file

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    implementation(project(path: ":CordovaLib"))
    compile "com.android.support:support-v4:26.+"
    compile "com.android.support:support-v13:26.+"
    compile "me.leolin:ShortcutBadger:1.1.17@aar"
    compile "com.google.firebase:firebase-messaging:11.6.2"
    compile "com.google.android.gms:play-services-location:11.+"

I get this error when I build app.
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 11.6.2.

when I change above part and compile again, it becomes to default setting again (above gradle file ines). from which library automatically build above lines when compiling.