0

im getting this error:

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/cl.rpro.vendormobile.taskmanager/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.1.0_35df9c24e83b197f349f916cbeab1f3731d6d9dd-classes.dex)

In this line:

if (checkPlayServices()) {
    // Start IntentService to register this application with GCM.
    Intent intent = new Intent(this, RPRORegistrationIntentService.class);//-> this one
    startService(intent);
}

Here are my dependences:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.squareup.picasso:picasso:2.4.0'
//compile 'io.realm:realm-android:0.79.0'
compile files('libs/mpandroidchartlibrary1_7_4.jar')
compile files('libs/java-json.jar')
compile 'com.android.support:support-v13:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.2'
//compile 'com.google.android.gms:play-services:6.5.87'
//compile 'com.android.support:support-v4:21.0.3'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'net.simonvt.menudrawer:menudrawer:3.0.6'
compile('com.crashlytics.sdk.android:crashlytics:2.2.0@aar') {
    transitive = true;
}
compile "com.google.android.gms:play-services:8.1.0"
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.github.aakira:expandable-layout:1.4.1@aar'
compile 'com.android.support:recyclerview-v7:+'
}

I have tried some solutions like this one but still didnt work.

Any help will be appreciated.

Community
  • 1
  • 1
Mr. Thanks a lot
  • 235
  • 4
  • 17
  • Looks like you are using play-services:8.1.0, you should be using 9.0.1, also you should be using the specific play services library eg: play-services-gcm instead of just play-services. – Arthur Thompson Jun 08 '16 at 14:35
  • Thanks! this solved my problem, you should put this comment as an answer so I can mark it as solved. – Mr. Thanks a lot Jun 09 '16 at 16:39

1 Answers1

0

Looks like you are using play-services:8.1.0, you should be using 9.0.1, also you should be using the specific play services library eg: play-services-gcm instead of just play-services.

I'd suggest you try firebase-messaging:9.0.1 the implementation is much simpler and it is a superset of the features available in play-services-gcm. See the docs for more.

Arthur Thompson
  • 9,087
  • 4
  • 29
  • 33