ClassNotFoundException: Didn't find class "android.databinding.DataBinderMapper"
<p>I am using android's data binding library  for views in a <b>library project</b></p>

<p>i have added the following line in my root gradle file</p>

<pre><code>classpath 'com.android.databinding:dataBinder:1.0-rc1'
</code></pre>

<p>and have enabled the dataBinding as given below in module's gradle file </p>

<pre><code>apply plugin: 'com.android.databinding'
...
...
android {
....
  dataBinding {
      enabled = true
  }
}
</code></pre>

<p>i have enabled the multiDex in my library project
as well as in the host app which is using this library
but i get this stack trace of error while launching the library's activity</p>

<pre><code>java.lang.NoClassDefFoundError: Failed resolution of: Landroid/databinding/DataBinderMapper;
    at android.databinding.DataBindingUtil.&lt;clinit&gt;(DataBindingUtil.java:31)
    at sdk.ui.activities.MyActivity.onCreate(MyActivity.java:76)
    at android.app.Activity.performCreate(Activity.java:6280)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1116)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2647)
    at android.app.ActivityThread.-wrap11(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1502)
    at android.os.Handler.dispatchMessage(Handler.java:111)
    at android.os.Looper.loop(Looper.java:207)
    at android.app.ActivityThread.main(ActivityThread.java:5763)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.databinding.DataBinderMapper" on path: DexPathList[[zip file "/data/app/testApp.dev-1/base.apk"],nativeLibraryDirectories=[/data/app/testApp.dev-1/lib/arm64, /data/app/testApp.dev-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    at android.databinding.DataBindingUtil.&lt;clinit&gt;(DataBindingUtil.java:31) 
    at sdk.ui.activities.MyActivity.onCreate(MyActivity.java:76) 
    at android.app.Activity.performCreate(Activity.java:6280) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1116) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2647) 
    at android.app.ActivityThread.-wrap11(ActivityThread.java) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1502) 
    at android.os.Handler.dispatchMessage(Handler.java:111) 
    at android.os.Looper.loop(Looper.java:207) 
    at android.app.ActivityThread.main(ActivityThread.java:5763) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749) 
Suppressed: java.lang.ClassNotFoundException: android.databinding.DataBinderMapper
    at java.lang.Class.classForName(Native Method)
    at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
    at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 15 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
</code></pre>