title: Build error when using Amazon Device Messaging: class must extend android.app.Service [Instantiatable]
body: <p>I'm integrating <strong>Amazon device messaging</strong> into my app following this <a href="https://developer.amazon.com/docs/adm/integrate-your-app.html" rel="nofollow noreferrer">Offical docs</a>. According to the docs, I have to create a class (MyADMMessageHandler.java) that extends <strong>ADMMessageHandlerJobBase</strong> and declare my class as a Service in AndroidManifest.xml</p>
  <p>AndroidManifest.xml</p>
  <pre><code>&lt;service android:name=&quot;.pn.MyADMMessageHandler&quot;
              android:exported=&quot;false&quot;
              android:permission=&quot;android.permission.BIND_JOB_SERVICE&quot;/&gt;
  </code></pre>
  <p>But when I built my app, I got this error</p>
  <pre><code>AndroidManifest.xml:153: Error: MyADMMessageHandler must extend android.app.Service [Instantiatable]
    &lt;service android:name=&quot;.pn.MyADMMessageHandler&quot;                           
  
     Explanation for issues of type &quot;Instantiatable&quot;:
     Activities, services, broadcast receivers etc. registered in the manifest
     file (or for custom views, in a layout file) must be &quot;instantiatable&quot; by
     the system, which means that the class must be public, it must have an
     empty public constructor, and if it's an inner class, it must be a static
     inner class.
  
  1 errors, 0 warnings
  
  BUILD SUCCESSFUL in 18s
  </code></pre>
  <p>Despite of this error, I still had BUILD SUCCESSFUL.
  I decompiled <strong>amazon-device-messaging-1.1.0.jar</strong> to see what's going on, but it just contains stub implementation and <strong>ADMMessageHandlerJobBase</strong> doesn't extends Service or any subclass of Service.</p>
  <p>So MyADMMessageHandler class isn't a Service but why do we need to declare it as a Service in AndroidManifest.xml?</p>
  <p>Note: In the <a href="https://amzndevresources.com/adm/sdk/AmazonDeviceMessaging.zip" rel="nofollow noreferrer">sample code</a> of Amazon device messaging, it also did the same.</p>
  <p><strong>Update 1</strong></p>
  <p>I've also asked <a href="https://forums.developer.amazon.com/questions/233699/build-error-class-must-extend-androidappservice-in.html" rel="nofollow noreferrer">here</a>, and received the answer:</p>
  <blockquote>
  <p>If you are following this <a href="https://developer.amazon.com/docs/adm/integrate-your-app.html" rel="nofollow noreferrer">1</a> documentation then you should be fine. The error you see should just be a warning and can be ignored. The declaration in AndroidManifest.xml is a must.</p>
  </blockquote>