0

My gradle versions

compileSdkVersion 24
buildToolsVersion "24.0.2"
minSdkVersion 17
targetSdkVersion 24
classpath 'com.google.gms:google-services:3.0.0'
compile "com.google.android.gms:play-services-gcm:9.4.0"

Below is my error message,

Caused by:

java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.tcs.fresco.talk.dev/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.3.0_6588f90e2e94e38ac1a1c0e6261e77a2c83f8cc8-classes.dex) at

com.google.android.gms.iid.zzd.zzdL(Unknown Source) at

com.google.android.gms.iid.zzd.(Unknown Source) at

com.google.android.gms.iid.zzd.(Unknown Source) at

com.google.android.gms.iid.InstanceID.zza(Unknown Source) at

com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)

Why this type of error is coming??

Any help will be appreciated,

Thank you.

Sabarinathan
  • 439
  • 1
  • 7
  • 19

1 Answers1

0

This is a ~ duplicate of:
IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM

TL;DR: com.google.android.gms:play-services-gcm:9.0.0 has the mentioned bug.
Please update to minimum 9.0.1

You said that your gradle is set to:

compile "com.google.android.gms:play-services-gcm:9.4.0"

but you must have some other dependencies that are pulling in the version 9.0.0

Check your dependencies graph with:

gradle -q app:dependencies --configuration compile
Community
  • 1
  • 1
Diego Giorgini
  • 12,489
  • 1
  • 47
  • 50