title: java.lang.NoClassDefFoundError: Failed resolution of: Lokio/ForwardingTimeout
body: <p>I am using a android project as library, which are using the following library added as a jar</p>
  
  <pre><code>okhttp-2.2.0.jar
  okhttp-urlconnection-2.2.0.jar
  okio-1.2.0.jar
  retrofit-1.9.0.jar
  </code></pre>
  
  <p>And in my main project I am using the following library </p>
  
  <pre><code>compile 'com.squareup.retrofit2:retrofit:2.1.0'
  compile 'com.squareup.retrofit2:converter-gson:2.1.0'
  compile 'com.squareup.okhttp3:okhttp:3.4.1'
  compile 'com.google.code.gson:gson:2.7'
  </code></pre>
  
  <p>And there are some other library, but after some research I have found that these are causing the problem.</p>
  
  <p>The app runs fine, but crashes with the following error when I tried to consume any web service using retrofit</p>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError: Failed resolution of: Lokio/ForwardingTimeout</p>
  </blockquote>
  
  <p>In my app level gradle file I have added </p>
  
  <pre><code>multiDexEnabled true
  </code></pre>
  
  <p>Also I tried adding </p>
  
  <pre><code>configurations{
      all*.exclude module: 'okhttp-2.2.0'
      all*.exclude module: 'okio'
  }
  </code></pre>
  
  <p>And I tried adding retrofit gradle dependency like following </p>
  
  <pre><code>compile ('com.squareup.retrofit2:retrofit:2.1.0') {
      exclude group: 'okio'
  }
  compile ('com.squareup.retrofit2:converter-gson:2.1.0') {
      exclude group: 'okio'
  }
  </code></pre>
  
  <p>None of these worked, my project was working fine before adding the library project. Any help would be appreciated. </p>