Retrofit unable to resolve host

I am trying to call an API through retrofits.
The url that I call, is located on a server, in which at this moment I access go VPN.
The token I am sending right now is good.
I have tested everything via postman and it works correctly.
Instead when I call through Android studio I get the exception “retrofit unable to resolve host”.
I have made various changes to the code, according to some examples found on the net, but I can not solve the problem.
If I use the same code to access the public bees of “” everything works correctly

    // var urlConnection: String ="http://iswvgenint03/api/"
     var urlConnection: String =""
     override fun onCreate(savedInstanceState: Bundle?) {
    var miocontext = this.baseContext

    //  textViewResult= findViewById(;

    val clientBuilder = OkHttpClient.Builder()

        override fun intercept(chain: Interceptor.Chain): okhttp3.Response? {

            val original = chain.request()
            val request = original.newBuilder()
                .header("Authorization",  authTokenBearer)
                .method(original.method(), original.body())

            return chain.proceed(request)

    //Add the interceptor to the client builder.
    val client: OkHttpClient =

    var retrofit = Retrofit.Builder()

    val jsonPlaceHolderApi = retrofit.create(

    val call = jsonPlaceHolderApi.getClients()

    call.enqueue(object : Callback<List<Client>> {
        override fun onResponse(call: Call<List<Client>>, response: Response<List<Client>>) {
            if (!response.isSuccessful) {
                //    textViewResult.setText("Code: " + response.code())

            val posts = response.body()!!

        override fun onFailure(call: Call<List<Client>>, t: Throwable) {


in an interface file I have
@GET (“Clients”)
fun getClients (): Call <List >

I arrive always in onFailure

The error messages I get are Unable to resolve host “iswvgenint03”: No address associated with hostname
if I use the url CLEARTEXT communication to not permitted by network security policy
if I use the ip address

I think android studio can’t get to the url via vpn.

Do you have any solution for me?

I solved it by adding this code to the manifest.xml file

  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


Then chased I found that Retrofit was unable to resolve the url with the VPN so everything worked with the ip address
and finally I modified the call in the interface

from so

    fun getClients(): Call<ClientList>


    fun getClients(): Call<ClientList>