Multipart request with Retrofit @PartMap Error in Kotlin (Android) : <p>If I am using this code in Java then its working fine. When I convert that code in kotlin then I got Error.</p>

<h2>Logcat</h2>

<blockquote>
  <p>08-20 23:46:51.003 3782-3782/com.qkangaroo.app W/System.err: java.lang.IllegalArgumentException: Parameter type must not include a type variable or wildcard: java.util.Map (parameter #1)
  08-20 23:46:51.003 3782-3782/com.qkangaroo.app W/System.err:     for method ApiInterface.updateCustomerDetail
  08-20 23:46:51.003 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:752)
  08-20 23:46:51.004 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.ServiceMethod$Builder.methodError(ServiceMethod.java:743)
  08-20 23:46:51.004 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.ServiceMethod$Builder.parameterError(ServiceMethod.java:761)
  08-20 23:46:51.004 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:195)
  08-20 23:46:51.004 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:170)
  08-20 23:46:51.005 3782-3782/com.qkangaroo.app W/System.err:     at retrofit2.Retrofit$1.invoke(Retrofit.java:147)
  08-20 23:46:51.005 3782-3782/com.qkangaroo.app W/System.err:     at $Proxy0.updateCustomerDetail(Native Method)
  08-20 23:46:51.005 3782-3782/com.qkangaroo.app W/System.err:     at com.qkangaroo.app.Fragments.MoreScreen.MoreFragment.updateProfile(MoreFragment.kt:261)
  08-20 23:46:51.006 3782-3782/com.qkangaroo.app W/System.err:     at com.qkangaroo.app.Fragments.MoreScreen.MoreFragment$clickListener$1.onClick(MoreFragment.kt:191)
  08-20 23:46:51.006 3782-3782/com.qkangaroo.app W/System.err:     at android.view.View.performClick(View.java:3517)
  08-20 23:46:51.006 3782-3782/com.qkangaroo.app W/System.err:     at android.view.View$PerformClick.run(View.java:14155)
  08-20 23:46:51.006 3782-3782/com.qkangaroo.app W/System.err:     at android.os.Handler.handleCallback(Handler.java:605)
  08-20 23:46:51.007 3782-3782/com.qkangaroo.app W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:92)
  08-20 23:46:51.007 3782-3782/com.qkangaroo.app W/System.err:     at android.os.Looper.loop(Looper.java:154)
  08-20 23:46:51.007 3782-3782/com.qkangaroo.app W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:4624)
  08-20 23:46:51.008 3782-3782/com.qkangaroo.app W/System.err:     at java.lang.reflect.Method.invokeNative(Native Method)
  08-20 23:46:51.009 3782-3782/com.qkangaroo.app W/System.err:     at java.lang.reflect.Method.invoke(Method.java:511)
  08-20 23:46:51.009 3782-3782/com.qkangaroo.app W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
  08-20 23:46:51.010 3782-3782/com.qkangaroo.app W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
  08-20 23:46:51.011 3782-3782/com.qkangaroo.app W/System.err:     at dalvik.system.NativeStart.main(Native Method)</p>
</blockquote>

<h2>fragment.kt</h2>

<pre><code>    var map:HashMap&lt;String,RequestBody&gt; = HashMap&lt;String, RequestBody&gt;()
    map.put("version",ApiClient.createRequestBody(AppConstants.API_VERSION))
    map.put("auth_token", ApiClient.createRequestBody(customer.authToken!!))
    map.put("customer_name",ApiClient.createRequestBody(profileName))
    map.put("email", ApiClient.createRequestBody(profileEmail))

    val apiInterface = ApiClient.client.create(ApiInterface::class.java)

    val updateCustomerCall: Call&lt;UpdateCustomer&gt; = apiInterface.updateCustomerDetail(map)
    updateCustomerCall.enqueue(object : Callback&lt;UpdateCustomer&gt; {
        override fun onResponse(call: Call&lt;UpdateCustomer&gt;?, response: Response&lt;UpdateCustomer&gt;?) {

        }

        override fun onFailure(call: Call&lt;UpdateCustomer&gt;?, t: Throwable?) {
            utilities!!.hideProgress(progress)
        }
    })
</code></pre>

<h2>ApiClient.kt</h2>

<pre><code>val MULTIPART_FORM_DATA = "multipart/form-data"

fun createRequestBody(s: String): RequestBody {
    return RequestBody.create(
            MediaType.parse(MULTIPART_FORM_DATA), s)
}
</code></pre>

<h2>ApiInterface,.kt</h2>

<pre><code>@Multipart
@POST("customer")
fun updateCustomerDetail(@PartMap map: Map&lt;String,RequestBody &gt;): Call&lt;UpdateCustomer&gt;
</code></pre>

<h2>Gradle file</h2>

<pre><code>implementation "com.squareup.okhttp3:okhttp:3.8.1"
implementation "com.squareup.okhttp3:logging-interceptor:3.8.1"
implementation ("com.squareup.retrofit2:retrofit:2.3.0"){
     exclude module: 'okhttp'
}
implementation "com.squareup.retrofit2:converter-gson:2.3.0"
</code></pre>
