com.google.android.gms.common.internal.safe parcel.safe parcelable not found

后端 未结 6 1159
走了就别回头了
走了就别回头了 2020-12-05 16:44

I am trying to add notification services to my app using FCM and tutorial given on https://www.simplifiedcoding.net/firebase-cloud-messaging-android/ Everything has done and

相关标签:
6条回答
  • 2020-12-05 17:28

    You must have all the google play service line in the same version:

    compile 'com.google.android.gms:play-services:11.0.1'
    compile 'com.google.android.gms:play-services-maps:11.0.1'
    compile 'com.google.firebase:firebase-core:11.0.1'
    compile 'com.google.firebase:firebase-messaging:11.0.1'
    
    0 讨论(0)
  • 2020-12-05 17:30

    Use something like this:

    dependencies {
        compile 'com.google.android.gms:play-services:11.0.1'
        compile 'com.google.firebase:firebase-core:11.0.1'
        compile 'com.google.firebase:firebase-messaging:11.0.1'
    }
    apply plugin: 'com.google.gms.google-services'
    

    Make sure apply plugin comes below dependencies.

    0 讨论(0)
  • 2020-12-05 17:31

    What finally saved me:

    In android studio, switch to Project view instead of Android view. Delete .gradle folderm and also the gradle.properties file. Clean the project. Sync gradle again.

    I have no clue why this worked. Deleting only the .gradle folder didn't do the job and the newly made gradle.properties is exactly the same as the old one! But my issue is fixed.

    0 讨论(0)
  • 2020-12-05 17:34

    It's an Android Studio bug, it is NOT offering to automatically upgrade firebase libs like it does for play-services* libs.

    autoupdate

    compile 'com.google.android.gms:play-services-drive:10.0.1'
    

    no autoupdate (need to manually up the version to same as play-services*)

    compile 'com.google.firebase:firebase-messaging:10.0.1'
    
    0 讨论(0)
  • 2020-12-05 17:39

    In your Gradle file all the versions of google-play-service and firebase should use the same version.

    As you are using :

     compile 'com.google.android.gms:play-services-drive:10.0.1'
    

    You should use :

    compile 'com.google.firebase:firebase-messaging:10.0.1' // and not 9.2.1

    0 讨论(0)
  • 2020-12-05 17:46

    Make sure your google service version matches your firebase version. currently compile 'com.google.android.gms:play-services-drive:10.0.1' does not match compile 'com.google.firebase:firebase-messaging:9.2.1' What you have to do is to change 'com.google.firebase:firebase-messaging:9.2.1' to 'com.google.firebase:firebase-messaging:10.0.1' so that the versions matches.

    0 讨论(0)
提交回复
热议问题