square / otto

An enhanced Guava-based event bus with emphasis on Android support.
http://square.github.io/otto/
Apache License 2.0
5.16k stars 847 forks source link

Can't use okhttp combine with otto? #177

Closed jompon closed 8 years ago

jompon commented 8 years ago

My Gradle compile 'com.squareup.okhttp:okhttp:2.6.0' compile 'com.squareup:otto:1.3.8'

public final class BusProvider {
  private static final Bus BUS = new Bus(); <--------Error on this line

  public static Bus getInstance() {
    return BUS;
  }

  private BusProvider() {
    // No instances.
  }
}

java.lang.NoClassDefFoundError: com.squareup.otto.ThreadEnforcer

JakeWharton commented 8 years ago

These libraries do not interact. Try a clean build or disable/update your ProGuard config as it might be erroneously stripping classes.

As this is a usage question and not a bug or feature request, StackOverflow is a better place for these types of general questions.