question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get "has no methods called onEvent" when onEvent is present and only when downloaded from Google Play

See original GitHub issue

Hello. I’ve been slowly tracking down a bug for the past week or longer and I’m hoping you can help me with it. I started using EventBus in my latest app and I love it. So simple. My problems occur when I download the app from Google Play. I get a crash with the following error:

java.lang.ExceptionInInitializerError at com.jbonesstudios.holdemcompare.activities.MainActivity.<init>(Unknown Source) at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1208) at android.app.Instrumentation.newActivity(Instrumentation.java:1067) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2299) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2495) at android.app.ActivityThread.access$900(ActivityThread.java:170) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1304) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5635) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) Caused by: a.a.a.h: Subscriber class com.jbonesstudios.holdemcompare.c.b has no methods called onEvent at a.a.a.o.a(Unknown Source) at a.a.a.c.a(Unknown Source) at a.a.a.c.a(Unknown Source) at com.jbonesstudios.holdemcompare.c.b.<init>(Unknown Source) at com.jbonesstudios.holdemcompare.c.b.<clinit>(Unknown Source) … 16 more

This doesn’t make sense to me because I do have an onEvent method in the file. Here are the pertinent code bits:

import de.greenrobot.event.EventBus;

public class MainActivity extends AppCompatActivity { private EventBus mEventBus = EventBus.getDefault();

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public void onResume() {
    super.onResume();
    mEventBus.register(this); //crashes when downloaded from Google Play
}

@Override
public void onPause() {
    mEventBus.unregister(this);
    super.onPause();
}

public void onEventMainThread(StopSimulationEvent event) {
    // code
}

}

I’m sure I must be doing something wrong because I haven’t found anyone else having the same problem. What am I missing? Can you help me?

-Joey

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

0reactions
mirceaniscommented, Sep 4, 2017

@bhavikgandhi007 was just about to post the new link, then I noticed @gregparsons has already posted it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Subscriber class ...TaskAdapter has no public methods called ...
TaskAdapter has no public methods called onEvent. It does however have such an a public method as listed below.
Read more >
Has no method called onEvent when run application. #179
In my android application I have a listview in a fragment and adapter class for the listview. I need event listeners for both...
Read more >
FileObserver - Android Developers
public abstract void onEvent (int event, String path) ... After the finalize method has been invoked for an object, no further action is...
Read more >
Bug - Applovin ad module crashes. - Unity Forum
I develop Android app only and use Rewarded Ad only. I have installed Applovin connector from Unity Editor (by clicking the button)
Read more >
Player Events - Brightcove Player Documentation
A media element presents audio data, or video and audio data, to the user. slaved. By default each media element has no MediaController...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found