Adam Pehas avatar image
Adam Pehas asked

Build error when using Amazon Device Messaging: class must extend [Instantiatable]

We are running into the same issue as the below post any support is welcome:

I'm integrating Amazon device messaging into my app following this Offical docs. According to the docs, I have to create a class ( that extends ADMMessageHandlerJobBase and declare my class as a Service in AndroidManifest.xml


<service android:name=".pn.MyADMMessageHandler"

But when I built my app, I got this error

AndroidManifest.xml:153: Error: MyADMMessageHandler must extend [Instantiatable]
  <service android:name=".pn.MyADMMessageHandler"                           

   Explanation for issues of type "Instantiatable":
   Activities, services, broadcast receivers etc. registered in the manifest
   file (or for custom views, in a layout file) must be "instantiatable" 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


Despite of this error, I still had BUILD SUCCESSFUL. I decompiled amazon-device-messaging-1.1.0.jar to see what's going on, but it just contains stub implementation and ADMMessageHandlerJobBase doesn't extends Service or any subclass of Service.

So MyADMMessageHandler class isn't a Service but why do we need to declare it as a Service in AndroidManifest.xml?

fire tvamazon device messagingandroid
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi Adam,

Thanks for posting. If I understood correctly, your project builds, but you are curious about the error and the reason for requiring implementation of a service? The ADM team is looking into this. Please also note that recently we released an A3L SDK, which is useful in case you are integrating both Firebase Cloud Messaging (FCM) and Amazon Device Messaging (ADM) in your project:

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.