3

In my build.gradle I was using this:

android {
    compileSdkVersion 23
    ....
    ....
    defaultConfig {
        ....
        targetSdkVersion 23
    }
}
....
....
dependencies {
    compile 'com.google.android.gms:play-services:9.0.0'
    ....
    ....
}

Everything was compiling correctly for me and I was in the process of publishing my app to the Google Play Store and to my surprise, Google did not let me publish it because I was using targetSdkVersion 23 and they wanted for me to use targetSdkVersion 26 minimum. I went ahead and changed my code to use targetSdkVersion 26 and the error I saw said that targetSdkVersion 26 required at least com.google.android.gms:play-services:10.2.1 or higher. I changed the code to this:

android {
    compileSdkVersion 26
    ....
    ....
    defaultConfig {
        ....
        targetSdkVersion 26
    }
}
....
....
dependencies {
    compile 'com.google.android.gms:play-services:10.2.1'
    ....
    ....
}

The error message this time was:

Error:(280, 61) error: cannot access zza class file for com.google.android.gms.common.internal.safeparcel.zza not found

enter image description here

Any ideas to fix what Android is complaining about this time?

UPDATE 1: I had removed the buildToolsVersion but I included the one for API Level 26:

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    ....
    ....
}
Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103

2 Answers2

1

You need to upgrade firebase-messaging to latest version

I upgraded it to implementation 'com.google.firebase:firebase-messaging:17.6.0'

And it worked perfectly well.

Note: always use latest versions.

Parmendra Singh
  • 1,015
  • 3
  • 15
  • 27
0

I had to upgrade to

compile 'com.google.android.gms:play-services:10.2.1'
compile "com.google.firebase:firebase-messaging:10.2.1"

instead of my previous values of

compile 'com.google.android.gms:play-services:9.8.0'
compile "com.google.firebase:firebase-messaging:9.0.0"
Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103