Skip to content

error NotificationIntentService has no zero argument constructor #2

@andrew19881123

Description

@andrew19881123

I saw the note on the nativescript blog

IntentService’s implementation needs to use a constructor that takes no arguments, but that currently is not possible through Java.

but how do I solve the problem to make this app works?

System.err: java.lang.RuntimeException: Unable to instantiate service com.tns.notifications.NotificationIntentService: java.lang.InstantiationException: java.lang.Class<com.tns.notifications.NotificationIntentService> has no zero argument constructor
09-14 21:49:13.297 12889 12889 W System.err:    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2862)
09-14 21:49:13.297 12889 12889 W System.err:    at android.app.ActivityThread.-wrap4(ActivityThread.java)
09-14 21:49:13.297 12889 12889 W System.err:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
09-14 21:49:13.300 12889 12889 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:102)
09-14 21:49:13.300 12889 12889 W System.err:    at android.os.Looper.loop(Looper.java:148)
09-14 21:49:13.300 12889 12889 W System.err:    at android.app.ActivityThread.main(ActivityThread.java:5417)
09-14 21:49:13.301 12889 12889 W System.err:    at java.lang.reflect.Method.invoke(Native Method)
09-14 21:49:13.301 12889 12889 W System.err:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-14 21:49:13.301 12889 12889 W System.err:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
09-14 21:49:13.301 12889 12889 W System.err: Caused by: java.lang.InstantiationException: java.lang.Class<com.tns.notifications.NotificationIntentService> has no zero argument constructor
09-14 21:49:13.301 12889 12889 W System.err:    at java.lang.Class.newInstance(Native Method)
09-14 21:49:13.301 12889 12889 W System.err:    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2859)
09-14 21:49:13.301 12889 12889 W System.err:    ... 8 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions