title: ANDROID - FATAL EXCEPTION: IntentService[] [..] java.lang.IncompatibleClassChangeError [..]
body: <p>I try send notification for my application with Google Cloud Message.</p>
  
  <p>I created a new project and I implemented the code and this work fine. but when i try implement in my application, the application show this error message:</p>
  
  <p><strong>ERROR MESSAGE:</strong></p>
  
  <pre><code>08-07 14:48:57.735 324-1057/br.com.pkg.project E/AndroidRuntime: FATAL EXCEPTION: IntentService[]
                                                                       Process: br.com.pkg.project, PID: 324
                                                                       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/br.com.auttar.auttarmobile/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.3.0_22bae0a13164f788de113fe2ab4647903157f661-classes.dex)
                                                                           at com.google.android.gms.iid.zzd.zzdL(Unknown Source)
                                                                           at com.google.android.gms.iid.zzd.&lt;init&gt;(Unknown Source)
                                                                           at com.google.android.gms.iid.zzd.&lt;init&gt;(Unknown Source)
                                                                           at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
                                                                           at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
                                                                           at br.com.pkg.project.tools.util.gcm.GCMRegistrationIntentService.registerGCM(GCMRegistrationIntentService.java:37)
                                                                           at br.com.pkg.project.tools.util.gcm.GCMRegistrationIntentService.onHandleIntent(GCMRegistrationIntentService.java:29)
                                                                           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)
  </code></pre>
  
  <p>I have this method in GCMRegistrationIntentService.class</p>
  
  <pre><code>private void registerGCM() {
      Intent registrationComplete = null;
      String token = null;
  
      try{
          InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
          token = instanceID.getToken(getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
  
          Log.v("GCMRegIntentService","TOKEN: "+token);
  
          registrationComplete = new Intent(REGISTRATION_SUCESS);
          registrationComplete.putExtra("token",token);
      } catch (Exception e) {
          Log.v("GCMRegIntentService","ERRO AO REGISTRAR O TOKEN");
          registrationComplete = new Intent(REGISTRATION_ERROR);
      }
      LocalBroadcastManager.getInstance(this).sendBroadcast(registrationComplete);
  }
  </code></pre>
  
  <p>The error it ocorred in this line:</p>
  
  <pre><code> InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
  </code></pre>
  
  <p>Manifest.xml permission</p>
  
  <pre><code>&lt;!-- To auto-complete the email text field in the login form with the user's emails --&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PROFILE" /&gt;
  &lt;!-- uses-permission android:name="android.permission.READ_CONTACTS" / --&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  
  &lt;permission android:name="br.com.pkg.project.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;
  &lt;uses-permission android:name="br.com.pkg.project.permission.C2D_MESSAGE" /&gt;
  </code></pre>
  
  <p>Manifest.xml receiver</p>
  
  <pre><code>enter code here        &lt;receiver
          android:name="com.google.android.gms.gcm.GcmReceiver"
          android:exported="true"
          android:permission="com.google.android.c2dm.permission.SEND"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE"/&gt;
              &lt;!-- PODE SER AQUI --&gt;
              &lt;category android:name="br.com.pkg.project"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service android:name=".tools.util.gcm.GCMPushReceiverService" android:exported="false"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE"/&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
      &lt;service android:name=".tools.util.gcm.GCMRegistrationIntentService" android:exported="false"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.gms.iid.InstanceID"/&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  </code></pre>
  
  <p><strong>build.Gradle</strong></p>
  
  <pre><code>    apply plugin: 'com.android.application'
  apply plugin: 'com.google.gms.google-services'
  
  android {
      compileSdkVersion 23
      buildToolsVersion "23.0.2"
  
      defaultConfig {
          applicationId "br.com.pkg.project"
          minSdkVersion 19
          targetSdkVersion 23
          versionCode 1
          versionName "1.0"
  
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      packagingOptions {
          exclude 'META-INF/ASL2.0'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/license.txt'
          exclude 'META-INF/NOTICE'
          exclude 'META-INF/notice.txt'
      }
  }
  
  
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:+'
      //compile 'com.android.support:appcompat-v7:23.1.1'
      compile 'com.android.support:design:23.1.1'
      compile 'com.google.code.gson:gson:2.2.4'
      //compile 'com.google.android.gms:play-services:9.4.0'
      compile 'com.google.android.gms:play-services:8.3.0'
      // http://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
      //compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3.4'
      //compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
      compile 'com.jjoe64:graphview:4.0.1'
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
      //compile 'org.springframework.android:spring-android-rest-template:2.0.0.M1'
      compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
      compile files('libs/spring-android-rest-template-1.0.1.RELEASE.jar')
  
  }
  </code></pre>
  
  <p><strong>build.Gradle</strong></p>
  
  <pre><code>    // Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.1.2'
          classpath 'com.google.gms:google-services:1.5.0-beta2'
          classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>I have Consulted other similar questions in the StackOverFlow, but not one solved my problem.</p>
  
  <p>Can anybody help me, please ?</p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>I include this dependences</p>
  
  <pre><code> configurations.all {
      resolutionStrategy {
          //force 'com.android.support:design:23.4.0'
          force 'com.android.support:support-v4:23.4.0'
          force 'com.android.support:appcompat-v7:23.4.0'
      }
  }
  </code></pre>
  
  <p>Studies by me, what was found : GCM no work with support version >=24</p>
  
  <p>Correct me if I'm wrong , but it worked </p>
  
  <p>Thank for all</p>