title: GCM Error - googleCloudMessaging.register
body: <p>I have the problem that the android application says. "The application xxxx Sorry stopped" to work with the push notificaction, when performing the debugger that happens when it passes:</p>
  
  <p>method 1</p>
  
  <pre><code>InstanceID InstanceId = InstanceID.getInstance (context);
  
   token = instanceID.getToken (key_id.toString ()
  
  GoogleCloudMessaging.INSTANCE_ID_SCOPE); getToken error,
  </code></pre>
  
  <p>method 2</p>
  
  <p>Both an the same mistake</p>
  
  <pre><code> if (googleCloudMessaging == null) {
  googleCloudMessaging = GoogleCloudMessaging.getInstance(context);
                      }
                      token = googleCloudMessaging.register(key_id);
  </code></pre>
  
  <p>note that the token is generated but the application is closed, error:</p>
  
  <pre><code>"The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir (android.content.Context)' was expected to be of type virtual but was found to be Instead of direct type (declaration of 'java.lang .reflect.ArtMethod 'appears in /system/framework/core-libart.jar)"
  </code></pre>
  
  <p>I am using android studio, for
  cdvCompileSdkVersion = android-22
  cdvBuildToolsVersion = 22.0.1</p>
  
  <p>Error:</p>
  
  <pre><code>"FATAL EXCEPTION: main
  Process:  PID: 11989
  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 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
      at com.google.android.gms.iid.zzd.zzde(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 com.google.android.gms.iid.InstanceIDListenerService.zzn(Unknown Source)
      at com.google.android.gms.iid.InstanceIDListenerService.onStartCommand(Unknown Source)
      at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2924)
      at android.app.ActivityThread.access$2100(ActivityThread.java:155)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1415)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5343)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)"
  </code></pre>
  
  <p>What could be the problem?</p>
  
  <p>Regards,</p>