title: Android project won't work when compiled by Android Studio 4.0.1
body: <p>This is a long story and I'm going try to provide as much details as I can.</p>
  <p>I have been using android studio 3.x.x to built my apps over several months, until recently it started to offer me an update to the newest stable 4.0.1.</p>
  <p>I updated and it was  hassle free as it was supposed to be, all plugins updated without error and the code compiled at first in the new android studio, the project worked fine in tests then i uploaded to the play store's internal test track (here the problem starts).</p>
  <p>the app started showing a some sort of lock or infinite loop error in some devices... it was weird because the very same devices when running the debug build were fine, at this moment i thought that some <code>proguard rules</code> are the problem. So I adjusted the <code>build.grade</code> file in order to the <code>debug</code> build have the same settings as the <code>release</code> build (shrink and minify TRUE).</p>
  <p>after compiled the app runs smoothly in the emulator and in the problematic devices...<br />
  once more i uploaded it to google play, and downloaded from there the app doesn't work...</p>
  <p>I made a very exhaustive and annoying code debug in order to get what method was being locked somehow and i found this suspect:</p>
  <pre><code>OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
      httpClientBuilder.readTimeout(15000, TimeUnit.MILLISECONDS);
      httpClientBuilder.writeTimeout(15000, TimeUnit.MILLISECONDS);
      httpClientBuilder.connectTimeout(15000, TimeUnit.MILLISECONDS);
      httpClientBuilder.retryOnConnectionFailure(true);
      httpClientBuilder.followRedirects(true);
      httpClientBuilder.followSslRedirects(true);
      httpClientBuilder.connectionPool(DEFAULT_CONNECTION_POOL);
      Dispatcher dispatcher = new Dispatcher();
      dispatcher.setMaxRequests(10);
      dispatcher.setMaxRequestsPerHost(10);
      httpClientBuilder.dispatcher(dispatcher);
      okHttpClient = httpClientBuilder.build();
  
  private boolean isInternetOK(){
      boolean ret = false;
      try {
          okHttpClient.newCall(new Request.Builder().get().url(&quot;https://www.google.com&quot;).build()).execute();
          ret true;
      } catch (Exception e) {                
      }
      return ret;
  }
  </code></pre>
  <p>In my launcher activity, before start login I verify if users internet connection is ok that is a simple code and the <code>httpclient</code> has a timeout of 15 seconds so would connect or fail fast.</p>
  <p>it made no sense to me why this specific method is working in dev and not working when served from play store (in the very same device and very same build config)</p>
  <p>I spend a few hours trying to solve the problem... until i decided to downgrade android studio to the previous version i was using. AND THE PROBLEM SOLVED BY ITSELF!</p>
  <p>So i'm 100% sure the problem is related to android studio 4.0.1 and its gradle plugin and how they interact with <code>&quot;com.squareup.okhttp3:okhttp:3.12.12&quot;</code></p>
  <p>here comes the observations i made:</p>
  <p>1- the apk generated by android studio 4.0.1 is 4.18MB while 3.6.3 generates a 4.33MB apk (same <code>build.config</code> and same <code>proguard.rules</code>)</p>
  <p>2- after update android studio to 4.0.1 proguard.rules started showing lots of erros, like is said here: <a href="https://stackoverflow.com/questions/62080165/unresolved-class-name-proguard-rules-android-studio-4-0">Unresolved class name proguard-rules Android Studio 4.0</a> but still compiles fine (and worked fine in debug with shrink and minify on)</p>
  <p>3- the only difference in the project is android studio version and  <code>com.android.tools.build:gradle</code> dependency, because it must follow android studio version.</p>
  <p>Well this is as far as I got, i'm available to provide any more info and even the apks compiled from the different versions if anyone can help me... now i need to sleep because is 23h30 today is Saturday and i lost 7 hours of my life in this junk update</p>