Robospice Impossible to start SpiceManager as no service of class

167 views
Skip to first unread message

Dipendra Pokharel

unread,
Sep 12, 2014, 12:24:16 PM9/12/14
to robo...@googlegroups.com

I am trying to use following libraries to develop my app.

Robospice

Gson

and Spring for android

To do so, In my gradle file I have following dependencies added

compile 'com.octo.android.robospice:robospice-spring-android:1.4.13'
compile 'com.google.code.gson:gson:2.2.4'

And in manifest file, I have following lines inserted inside application tag.

<service
    android:name="com.octo.android.robospice.GsonSpringAndroidSpiceService"
    android:exported="false" />

Now, I created a base class that is used as Base Activity. And, I have did this in the following way:

public class BaseSpiceActivity extends Activity {
    private SpiceManager spiceManager = new SpiceManager(GsonSpringAndroidSpiceService.class);

    @Override
    protected void onStart() {
        spiceManager.start(this);
        super.onStart();
    }

    @Override
    protected void onStop() {
        spiceManager.shouldStop();
        super.onStop();
    }

    protected SpiceManager getSpiceManager() {
        return spiceManager;
    }  
}

And then I used that base class to extend my own class where I had to use spice service request.

SimpleTextRequest text = new SimpleTextRequest(placeUrl);   
getSpiceManager().execute(text, "place", DurationInMillis.ONE_MINUTE, new RequestListener<String>() { 

    //Other functions and codes

    }
)

But when the above code gets executed, I am getting following error

 E/AndroidRuntime﹕ FATAL EXCEPTION: SpiceManagerThread 0
java.lang.RuntimeException: Impossible to start SpiceManager as no service of class : com.octo.android.robospice.SpiceService is registered in AndroidManifest.xml file !
        at com.octo.android.robospice.SpiceManager.checkServiceIsProperlyDeclaredInAndroidManifest(SpiceManager.java:1287)
        at com.octo.android.robospice.SpiceManager.tryToStartService(SpiceManager.java:1168)
        at com.octo.android.robospice.SpiceManager.run(SpiceManager.java:247)
        at java.lang.Thread.run(Thread.java:856)

I have been trying to solve the issue from many hours. But unfortunately couldn't. Please help me out.

Stéphane NICOLAS

unread,
Sep 12, 2014, 6:05:06 PM9/12/14
to robo...@googlegroups.com

Search for all the occurrences of 'new SpiceManager'. Chances are that you instantiate one using a wrong service class.

Also, you should switch the 2 statements in onStart.

S.

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "RoboSpice".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse robospice+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Dipendra Pokharel

unread,
Sep 13, 2014, 4:16:09 AM9/13/14
to robo...@googlegroups.com
Thanks alot.
Accidently, I used base class 'SpiceActivity' from the library itself instead of my own BaseClass that I declared. 

Aniruthan Rajaram R

unread,
Nov 26, 2015, 1:28:16 AM11/26/15
to RoboSpice

HI Sir,

I am also facing now below  mentioned issues.please tell me how to fix that

Moritz

unread,
Nov 26, 2015, 2:35:48 AM11/26/15
to RoboSpice
What issue, exactly are you facing?  Could you elaborate?
Reply all
Reply to author
Forward
0 new messages