title: NoClassDefFoundError when referencing ReactScrollView method in React Native Android
body: <p>I am attempting to hide the ActionBar and FloatingActionButton in native when the user scrolls the content of a ReactNativeView. Intuitively, this should be done with a callback from JS back to native. However, the <a href="https://facebook.github.io/react-native/docs/native-modules-android.html#callbacks" rel="nofollow noreferrer">documentation</a> states "a native module is supposed to invoke its callback only once." This is unsuitable for my use case as I need to be able to monitor a consistent stream of scrolling callbacks.</p>
  
  <p>To get around this, I set up a GlobalLayoutListener on the ReactNativeView and set my OnScrollChangeListener when I observed that React Native injected the ReactScrollView. This works perfectly on API 22. However, on API 21, it throws a NoClassDefFoundError at the point that I attempt to set the OnScrollChangeListener. There are a couple errors above the stack trace: 'Link of class ScrollAnimator failed' and 'Unable to resolve virtual method ScrollView.setOnScrollChangeListener.' </p>
  
  <p>I understand the NoClassDefFoundError arises from the library being present at compile time, but not at run time. This is a project configuration issue often caused by having references to two different versions of the same library. More can be read about NoClassDefFoundError in this popular <a href="https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java">StackOverflow question</a>.</p>
  
  <p>I am fairly sure I don't have such a project configuration issue because it works just fine on API 22. So, what's going on here then? Further, am I going about solving this problem the right way? Or, is there a better way to emit scroll change events from JS to native?</p>