title: Retrofit 2.6.0 exception: java.lang.IllegalArgumentException: Unable to create call adapter for kotlinx.coroutines.Deferred
body: <p>I have a project with Kotlin coroutines and Retrofit.</p>
  
  <p>I had these dependencies:</p>
  
  <pre><code>implementation 'com.squareup.retrofit2:retrofit:2.5.0'
  implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
  implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
  </code></pre>
  
  <p>Today I have updated <strong>Retrofit</strong> to <strong>2.6.0</strong> in the project. In <a href="https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter" rel="noreferrer">https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter</a> it is written that it is deprecated now. In <a href="https://github.com/square/retrofit/blob/master/CHANGELOG.md#version-260-2019-06-05" rel="noreferrer">https://github.com/square/retrofit/blob/master/CHANGELOG.md#version-260-2019-06-05</a> it is written that Retrofit currently supports <code>suspend</code>.</p>
  
  <p>So, I removed <code>retrofit2-kotlin-coroutines-adapter:0.9.2</code> and in Retrofit client changed these lines:</p>
  
  <pre><code>        retrofit = Retrofit.Builder()
              .baseUrl(SERVER_URL)
              .client(okHttpClient)
              .addConverterFactory(MyGsonFactory.create(gson))
              //.addCallAdapterFactory(CoroutineCallAdapterFactory()) - removed it.
              .build()
  </code></pre>
  
  <p>When run, the first request catches an exception:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Unable to create call adapter for kotlinx.coroutines.Deferred&lt;com.package.model.response.UserInfoResponse&gt;
      for method Api.getUserInfo
  </code></pre>
  
  <p>As I understood, instead of <code>CoroutineCallAdapterFactory()</code> I could use <code>CallAdapter.Factory()</code>, but it is abstract.</p>
  
  <p>If in Api class I change a request adding <code>suspend</code> in the beginning:</p>
  
  <pre><code>@FormUrlEncoded
  @POST("user/info/")
  suspend fun getUserInfo(@Field("token") token: String): Deferred&lt;UserInfoResponse&gt;
  
  override suspend fun getUserInfo(token: String): Deferred&lt;UserInfoResponse&gt; =
      service.getUserInfo(token)
  </code></pre>
  
  <p>I get this exception:</p>
  
  <pre><code>java.lang.RuntimeException: Unable to invoke no-args constructor for kotlinx.coroutines.Deferred&lt;com.package.model.response.UserInfoResponse&gt;. Registering an InstanceCreator with Gson for this type may fix this problem.
  </code></pre>