Home » Android » java – GreenRobot's eventbus can't see annotation, "no public methods"

java – GreenRobot's eventbus can't see annotation, "no public methods"

Posted by: admin June 15, 2020 Leave a comment


So, I found out about Green Robots’ eventbus module. Followed the instructions on this page to try to get it working:

Seems simple enough.

I put in the appropriate code, but when run on device I get a crash:

org.greenrobot.eventbus.EventBusException: Subscriber class com.crowdlab.activities.LoadingActivity and its super classes have no public methods with the @Subscribe annotation.

The first few lines of my class look like this:

public class LoadingActivity extends BaseActivity implements AlertDialogButtonListener {
    AlertDialog mDialog = null;
    AlertDialog mPushDialog = null;

    public void onMessageEvent(MessageEvent event){
        Toast.makeText(this, "From Loading "+event.message, Toast.LENGTH_SHORT).show();

    public void onStart() {

    public void onStop() {

It /seems/ the annotation is there. The compile happens without so much as a warning. I’m using version 3.0.0 as specified in the gradle file…

So what could be wrong? (RTFM gratefully accepted, just tell where the FM with a relevant article is.)



How to&Answers:

Doh! I chose Google’s @Subscribe rather than Green Robot’s.

import com.google.common.eventbus.Subscribe;

rather than

import org.greenrobot.eventbus.Subscribe;

The error should probably read “no method’s implementing the com.greenrobot.eventbus @Subscribe annotation”.