Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeException when implementing proguard with EventBus AsyncExecutor #131

Closed
z0lope0z opened this issue Nov 25, 2014 · 2 comments
Closed

Comments

@z0lope0z
Copy link

Hi! I'm not sure how to file reports and I'm not sure what's going on as well.
Basically, I'm currently implementing proguard in my project and this line of code fails:

...
 AsyncExecutor.builder().failureEventType(FailedEvent.class)
...

throwing the exception (here):

...
java.lang.RuntimeException: Failure event class must have a constructor with one parameter of type Throwable
    at de.greenrobot.event.util.AsyncExecutor.<init>(AsyncExecutor.java:104)
    at de.greenrobot.event.util.AsyncExecutor.<init>(AsyncExecutor.java:32)
...

unless I add

-keep class FailedEvent { *; }

to my proguard-rules.txt

If it's an expected behavior, should the best course of action be to include it in the wiki?

@greenrobot
Copy link
Owner

Right. Documented in 5619fea

Check updated https://github.com/greenrobot/EventBus/blob/master/HOWTO.md#proguard-configuration

Does it work for you?

@wrozwad
Copy link

wrozwad commented Dec 21, 2015

Unfortunately current ProGuard config doesn't work for me:

-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent {
    <init>(java.lang.Throwable);
}

I still received below runtime exception:

java.lang.RuntimeException: Failure event class must have a constructor with one parameter of type Throwable

Changing above -keepclassmembers to below -keep class fixed it for me:

-keep class de.greenrobot.event.util.ThrowableFailureEvent { *; }

EventBus: 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants