Renaud Favier Renaud Favier - 1 year ago 188
Java Question

GreenRobot EventBus, ClassNotFoundException still there after using Subscriber Index

I have the common "ClassNotFoundException" issue EventBus with a 4.4.2 device,
It's even troubleshot in the FAQ

I first double checked that I didn't use any unapropriated lifecycle methods but I didn't. Then I updated to EventBus 3.0.0, and used "suscribers index". But the bug is still here and I still can see in my stacktrace that the builder is trying to use reflexivity (


Caused by: java.lang.ClassNotFoundException: Didn't find class "android.os.PersistableBundle" on path: DexPathList[[zip file "/data/app/"],nativeLibraryDirectories=[/data/app-lib/, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.Class.getDeclaredMethods(Native Method) 
at java.lang.Class.getPublicMethodsRecursive( 
at java.lang.Class.getMethods( 
at org.greenrobot.eventbus.SubscriberMethodFinder.findUsingReflectionInSingleClass( 
at org.greenrobot.eventbus.SubscriberMethodFinder.findUsingInfo( 
at org.greenrobot.eventbus.SubscriberMethodFinder.findSubscriberMethods( 
at org.greenrobot.eventbus.EventBus.register( 
at ...

Player Activity

@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(QuestionFragment.EnableNextEvent event) {

/* ...... */


protected void onStart() {
EventBus.builder().addIndex(new MyEventBusIndex()).build().register(this);

protected void onStop() {

is available so i guess my build files are fine.

Please let me know if you see what's the problem.

Answer Source

I had the same error on Galaxy s3 (android 4.3). It happens on Android where API level less than 21 and you have direct reference to PersistableBundle.

"EventBus 3 with an subscriber index" didn't help to me (as and to you). So the workaround I found here.

A bit more of the error/cause is here.

P.S. eventbus 3.0.0

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download