Support Topics Documentation Slack YouTube Blog

Unable to instantiate service com.backendless.push.BackendlessFCMService

I am getting issue on “unable to instantiate service com.backendless.push.BackendlessFCMService…” on device while send push push notification

My manifest file is as below:

<?xml version='1.0' encoding='utf-8'?>

attach manifest file, and show the full message please

AndroidManifest.xml (3.4 KB)

Please check once the manifest file

Can you please provide full error message

java.lang.RuntimeException: Unable to instantiate service com.backendless.push.BackendlessFCMService: java.lang.ClassNotFoundException: Didn’t find class “com.backendless.push.BackendlessFCMService” on path: DexPathList[[zip file “/data/app/com.test.APP-1/base.apk”],nativeLibraryDirectories=[/data/app/com.test.APP-1/lib/arm64, /vendor/lib64, /system/lib64]]
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.backendless.push.BackendlessFCMService” on path: DexPathList[[zip file “/data/app/com.test.APP-1/base.apk”],nativeLibraryDirectories=[/data/app/com.test.APP-1/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
… 8 more
Suppressed: java.lang.ClassNotFoundException: com.backendless.push.BackendlessFCMService
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(
at java.lang.BootClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
… 10 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack tr

it seem that you do not include backendless android sdk, because android could not find the class BackendlessFCMService

I am using js sdk for backendless, i need to include android sdk too?

I have included ‘compile ‘com.backendless:backendless:5.2.4’’ in dependencies of app level gradle file now i am getting fallowing issue

java.lang.NoSuchMethodError: No virtual method toIntent()Landroid/content/Intent; in class Lcom/google/firebase/messaging/RemoteMessage; or its super classes (declaration of ‘’ appears in /data/app/com.test.APP/base.apk)
at com.backendless.push.BackendlessFCMService.onMessageReceived(
at Source)
at Source)
at Source)
at$ Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

i’ve noticed misconfiguration in your manifest.

        <service android:name="com.backendless.push.BackendlessFCMService">
                <action android:name="" />
        <service android:name="com.gae.scaffolder.plugin.MyFirebaseMessagingService">
                <action android:name="" />

As i understood MyFirebaseMessagingService extends BackendlessFCMService.
And you should leave only one service.

means i need to remove service with “MyFirebaseMessagingService”

Actually to get the device token i have used "", i think due to this the problem comes, can you suggest about this?

please suggest how to get device token for push notifications in js sdk?

The discussion have been continued in Slack.
In short words:
We have no solution for ionic framework. To receive device token you should use native code (our android sdk, written in Java). Or you may look for a solution yourself.

Presently i am using using js sdk, so i need to convert all things into android sdk?