stephanenicolas / robospice

Repo of the Open Source Android library : RoboSpice. RoboSpice is a modular android library that makes writing asynchronous long running tasks easy. It is specialized in network requests, supports caching and offers REST requests out-of-the box using extension modules.
Apache License 2.0
2.95k stars 545 forks source link

Could not find class 'com.octo.android.robospice.persistence.ObjectPersister' #461

Open manikavi opened 7 years ago

manikavi commented 7 years ago

Hi, After migrating my project from eclipse to android studio 2.2,I am getting this issue,any help to resolve this issue?

E/dalvikvm: Could not find class 'com.octo.android.robospice.persistence.ObjectPersister', referenced from method com.octo.android.robospice.persistence.CacheManager.addPersister

build.gradle is

    compile files('libs/commons-io-1.3.2.jar')
    compile files('libs/commons-lang3-3.1.jar')
    compile files('libs/jsr305-1.3.9.jar')
    compile files('libs/robospice-1.4.11.jar')
    compile files('libs/robospice-cache-1.4.11.jar')
    compile files('libs/robospice-google-http-client-1.4.11.jar')
mykolaj commented 7 years ago

Hello. Could you please ask that kind of things on Stackoverflow? This isn't an issue of Robospice but of your project/build tools setup. There's no need to clog a section which is intended for different kind of things.

manikavi commented 7 years ago

Hi, I thought this is related to robospice lib,So i posted here

manikavi commented 7 years ago

Hello, My issue is in detail below,May i know the reason,why you said,this isn't an issue of Robospice

V//SpiceManager.java:1189: 18:06:45.854 SpiceManagerThread 0 Binding to service succeeded.
E/AndroidRuntime: FATAL EXCEPTION: main
                  java.lang.NoClassDefFoundError: com.octo.android.robospice.priority.PausablePriorityBlockingQueue
                      at com.octo.android.robospice.priority.PausableThreadPoolExecutor.<init>(PausableThreadPoolExecutor.java:25)
                      at com.octo.android.robospice.priority.PriorityThreadPoolExecutor.<init>(PriorityThreadPoolExecutor.java:23)
                      at com.octo.android.robospice.priority.PriorityThreadPoolExecutor.getPriorityExecutor(PriorityThreadPoolExecutor.java:35)
                      at com.octo.android.robospice.SpiceService.getExecutorService(SpiceService.java:228)
                      at com.octo.android.robospice.SpiceService.onCreate(SpiceService.java:117)
                      at android.app.ActivityThread.handleCreateService(ActivityThread.java:2401)
                      at android.app.ActivityThread.access$1600(ActivityThread.java:140)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1310)
                      at android.os.Handler.dispatchMessage(Handler.java:99)
                      at android.os.Looper.loop(Looper.java:137)
                      at android.app.ActivityThread.main(ActivityThread.java:4895)
                      at java.lang.reflect.Method.invokeNative(Native Method)
                      at java.lang.reflect.Method.invoke(Method.java:511)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
                      at dalvik.system.NativeStart.main(Native Method)
D//SpiceManager.java:1236: 18:06:45.855 SpiceManagerThread 0 Waiting for service to be bound.
mykolaj commented 7 years ago

Well, lets say i've said that because i use Robospice in every single project i do which required REST communications, and haven't struggled with this error that much that only thing left to do is to open an issue on Github. That's one thing. A lot of people use it too by the way.

Second thing is that you've posted two different errors already. That's right. Not one error but two errors. Which may indicate that there's definitely something going on.

Third thing is that some time ago i've made a module for Robospice and was forced to understand some inner Robospice organization because of that. One of those things was tests. Tests which wouldn't have passed in case of some class definitions wasn't found.

One more thing - which is based on my own experience completely and IS NOT to be TRUSTED because of that - is that every time NoClassDefFoundError occured to me meant someone has something messed up with build chain. Maybe ProGuard shrinking or renaming your classes. Check that.

Also take into your sight that when i say "Robospice" i mean "Robospice 1.4.14".

But please don't take my word as indisputable truth. I may be very wrong because i haven't tried every possible combinations of android build tools versions and gradle plugin versions.