我什麼也沒做,但在logcat中有一個「IncompatibleClassChangeError」。我該如何解決這個GCM IncompatibleClassChangeError?
FATAL EXCEPTION: IntentService[]
Process: com.yorgan.ilknurbalcipc.yorgan, PID: 982
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.yorgan.ilknurbalcipc.yorgan/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.4.0_8028f35ea877b98f3f5d34335c02399b7cabc31e-classes.dex)
at com.google.android.gms.iid.zzd.zzeb(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.yorgan.ilknurbalcipc.yorgan.CARDS.GOOGLE_CLOUD_MESSAGING.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:62)
at com.yorgan.ilknurbalcipc.yorgan.CARDS.GOOGLE_CLOUD_MESSAGING.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:36)
at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.os.HandlerThread.run(HandlerThread.java:61)
而且我編譯SDK版本是24。此外,
compile 'com.google.android.gms:play-services:8.4.0'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
我,版本不兼容。如果編譯SDK版本爲23,則應用程序有效。在這種情況下,應用程序在API 24設備中不起作用。