Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6935687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:08:07+00:00 2026-05-27T12:08:07+00:00

Possible Duplicate: Android RuntimeException: Unable to instantiate the service Problem: starting an IntentService generates

  • 0

Possible Duplicate:
Android RuntimeException: Unable to instantiate the service

Problem: starting an IntentService generates a RuntimeException.

I’m clueless. If you need more info, just ask. Log:

D/dalvikvm( 6839): newInstance failed: no <init>()
D/AndroidRuntime( 6839): Shutting down VM
W/dalvikvm( 6839): threadid=1: thread exiting with uncaught exception (group=0x40015560)
E/AndroidRuntime( 6839): FATAL EXCEPTION: main
E/AndroidRuntime( 6839): java.lang.RuntimeException: Unable to instantiate service org.xyz.android.service.MyService: java.lang.InstantiationException: org.xyz.android.service.MyService
E/AndroidRuntime( 6839):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1929)
E/AndroidRuntime( 6839):    at android.app.ActivityThread.access$2500(ActivityThread.java:117)
E/AndroidRuntime( 6839):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:985)
E/AndroidRuntime( 6839):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 6839):    at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 6839):    at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 6839):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6839):    at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 6839):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 6839):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 6839):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 6839): Caused by: java.lang.InstantiationException: org.xyz.android.service.MyService
E/AndroidRuntime( 6839):    at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 6839):    at java.lang.Class.newInstance(Class.java:1409)
E/AndroidRuntime( 6839):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:1926)
E/AndroidRuntime( 6839):    ... 10 more

This code calls the service (it’s being called from a ContentProvider):

Intent i = new Intent(
        getContext(),
        MyService.class);
    i.putStringArrayListExtra(EXTRA_MISSING, missingMonths);
    i.putExtra(EXTRA_URI, uri);
    i.putExtra(EXTRA_START, startTime);
    i.putExtra(EXTRA_END, endTime);
    getContext().startService(i);

And this is the IntentService relevant code blocks (there are only two methods. Besides the asynctask itself, of course):

public MyService(String name) {
    super("MyService");
}

@Override
protected void onHandleIntent(Intent intent) {
        // ... do stuff
        new DownloaderTask().execute(missingMonths);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:08:07+00:00Added an answer on May 27, 2026 at 12:08 pm

    You appear to be missing the zero-argument public constructor. Delete the String name from your current constructor (since you’re not using it anyway), and you should be good to go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Android AdMobs problem. I am trying to put in an ad but
Possible Duplicate: Problem installing my Android apps Any body can tell me how can
Possible Duplicate: Android - get path of resource I need to know the string
Possible Duplicate: Standard Android Button with a different color I have 1 problem -
Possible Duplicate: how to call RESTful web service from android? This is my web
Possible Duplicate: NoClassDefFoundError - Eclipse and Android I'm seeing this question is getting asked
Possible Duplicate: Seemingly useless debugging environment for Android I've obviously been spoiled by Visual
Possible Duplicate: Android SMS Receiver not working I am in the beginning stages of
Possible Duplicate: Android :Text Animation I want to know how I can implement the
Possible Duplicate: Android Launch an application from another application I want to start Another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.