title: Failed to resolve target intent service. Push notifications Android
body: <p>I am getting following error when trying to configure Push Notification:</p>
  
  <blockquote>
    <p>Failed to resolve target intent service, skipping classname enforcement <br>
    Error while delivering the message: ServiceIntent not found.</p>
  </blockquote>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;manifest package="com.packageName"
        xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;  &lt;!-- support previous 4.4 KitKat devices--&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.packageName.permission.C2D_MESSAGE" /&gt;
  &lt;application
      android:name="AppName"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@android:style/Theme.Black.NoTitleBar"&gt;
      &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;category android:name="com.packageName" /&gt;
          &lt;/intent-filter&gt;
          &lt;intent-filter&gt; &lt;!-- support previous 4.4 KitKat devices--&gt;
              &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
              &lt;category android:name="com.packageName" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
      &lt;service
          android:name="com.packageName.activities.RegistrationIntentService"
          android:exported="false" &gt;
      &lt;/service&gt;
      &lt;service
          android:name="com.packageName.activities.GcmIDListenerService"
          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;
      &lt;service
          android:name="com.packageName.activities.MyGcmListenerService"
          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;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>MyGcmListenerService:</p>
  
  <pre><code>public class MyGcmListenerService extends GcmListenerService {
  
      @Override
      public void onMessageReceived(String from, Bundle data) {
          String message = data.getString("message");
          Log.d("From", "From: " + from);
          Log.d("Msg", "Message: " + message);
  
      }
  
  }
  </code></pre>
  
  <p>RegistrationIntentService</p>
  
  <pre><code>public class RegistrationIntentService extends IntentService {
     private static String SENDER_ID = "MySenderID";
  
     public RegistrationIntentService(){
         super(SENDER_ID);
     }
  
     @Override
     public void onHandleIntent(Intent intent){
  
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
  
        try {
            InstanceID instanceID = InstanceID.getInstance(this);
            String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
                GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
            Log.i("TOKEN", "GCM Registration Token: " + token);
        } catch (Exception e) {
            Log.d("Fail token", "Failed to complete token refresh", e);
        }
  
    }
  
  
  }
  </code></pre>
  
  <p>GcmIDListenerService</p>
  
  <pre><code>public class GcmIDListenerService extends InstanceIDListenerService {
      @Override
      public void onTokenRefresh() {
          Intent intent = new Intent(this, RegistrationIntentService.class);
          startService(intent);
      }
  }
  </code></pre>
  
  <p>I have placed google-services.json in projectName/app</p>
  
  <p>I send push notification from web <a href="http://techzog.com/development/gcm-notification-test-tool-android/" rel="nofollow">http://techzog.com/development/gcm-notification-test-tool-android/</a> and the response is success:1 but it not received in Android device.</p>