title: Unable to invoke no-args constructor for interface retrofit2.http.Url. Register an InstanceCreator with Gson for this type to fix this problem
body: <p>I have a problem with <code>Retrofit</code> and <code>Gson</code> and I don't know why?</p>
  
  <p>My app has an error when I send data for login:</p>
  
  <blockquote>
    <p>Unable to invoke no-args constructor for interface retrofit2.http.Url.
    Register an InstanceCreator with Gson for this type to fix this
    problem.</p>
  </blockquote>
  
  <p>Earlier, I made this app with Java and had exactly the same code and didn't have any error. But why now with Kotlin?? </p>
  
  <p>Main Activity:</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
              setContentView(R.layout.activity_main)
              val editText_login_user=findViewById&lt;EditText&gt;(R.id.Login_username)
              val editText_login_password=findViewById&lt;EditText&gt;(R.id.Login_password)
              val button_login=findViewById&lt;Button&gt;(R.id.btn_login)
              button_login.setOnClickListener(View.OnClickListener { Connect_login(editText_login_user.text.toString(),editText_login_password.text.toString()) })
      }
      fun Connect_login(user:String,pass:String):Boolean{
          var client= OkHttpClient()
          var retrofit = Retrofit.Builder()
              .baseUrl("http://sobosha.ir/")
              .client(client)
              .addConverterFactory(GsonConverterFactory.create())
              .build()
          val services=retrofit.create(ApiRet::class.java)
          val call =services.Logindata(user,pass)
          call.enqueue(object : Callback&lt;User_info&gt;{
              override fun onResponse(call: Call&lt;User_info&gt;, response: retrofit2.Response&lt;User_info&gt;) {
                  val user: User_info? = response.body()
                  Toast.makeText(applicationContext, user?.name,Toast.LENGTH_LONG).show()
              }
              override fun onFailure(call: Call&lt;User_info&gt;, t: Throwable) {
                  Toast.makeText(applicationContext, t.message,Toast.LENGTH_LONG).show()
                  val editText_login_passwords=findViewById&lt;EditText&gt;(R.id.Login_password)
                  editText_login_passwords.setText(t.message)
              }
          })
          return false
      }
  }
  </code></pre>
  
  <p>Interface:</p>
  
  <pre><code>public interface ApiRet {
  
      @FormUrlEncoded
      @POST("/Login.php")
      Call&lt;User_info&gt; Logindata(@Field("username") String user, @Field("password") String pass);
  }
  </code></pre>
  
  <p>and my User_info:</p>
  
  <pre><code>class User_info{
  
      @SerializedName("name")
      var name: String? = null
      @SerializedName("image_url")
      var image_url: Url? = null
      @SerializedName("correct")
      var correct:Boolean ?= null
  }
  </code></pre>
  
  <p>And i change interface to this</p>
  
  <pre><code>interface Apiservices{
  
      @FormUrlEncoded
      @POST("Login.php")
      fun Login(@Field("username") user: String, @Field("password") pass: String): Call&lt;User_info&gt;
  }
  </code></pre>
  
  <p>But it doesn't change the error.</p>