title: Builds from Android Studio Windows start slower on device than builds from Android Studio Mac OS
body: <p>I have an android project and up until a few weeks ago I worked on a macbook on it. The builds were starting instantly after Android Studio installed them on the device.</p>
  
  <p>After I've moved to a new windows laptop running the same version of Android Studio and JDK 8 I've noticed the builds start a lot slower. By that I mean that after AS has installed and ran the app, the app stays in a white screen for about 4-5 seconds on average (up to 15-20seconds) after the first activity runs.</p>
  
  <p>Videos:</p>
  
  <p>Building on Mac OS: <a href="https://youtu.be/H55mfxOoBbM" rel="nofollow">https://youtu.be/H55mfxOoBbM</a></p>
  
  <p>Building on Windows: <a href="https://youtu.be/-7FphwiMvs8" rel="nofollow">https://youtu.be/-7FphwiMvs8</a></p>
  
  <p>It feels like when you're running in debug mode and it's waiting for the debug process to attach. I don't remember if I changed the settings in my Android Studio on mac because I've been migrating the configs for over 3 years.</p>
  
  <p>What do I have to do to fix this?</p>
  
  <p>EDIT: My guess would be that the windows bulid triggers the jit compiler.</p>
  
  <p>Android Studio 2.1.2</p>
  
  <p>Java 1.8 u91</p>
  
  <p>Project gradle file:</p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.1.2'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
          maven { url "https://jitpack.io" }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>Build gradle file:</p>
  
  <pre><code> /*
   * Gets the version name from the latest Git tag
   */
  
  def getVersionName = { -&gt;
      def stdout = new ByteArrayOutputStream()
      def command = 'git'
  
      if (System.properties['os.name'].toLowerCase().contains('windows')) {
          command = 'C:/Program Files/Git/cmd/git.exe'
      }
  
      exec {
          commandLine command, 'describe', '--tags'
          standardOutput = stdout
      }
      return stdout.toString().trim()
  }
  
  project.ext.versionPropsFile = file('version.properties')
  
  def getBuildNumber() {
      def Properties versionProps = new Properties()
      versionProps.load(new FileInputStream(project.versionPropsFile))
      def buildNumber = versionProps['artifactBuildNumber'].toInteger() + 1
      versionProps['artifactBuildNumber'] = buildNumber.toString()
      versionProps.store(versionPropsFile.newWriter(), null)
      return buildNumber
  }
  
  def getReleaseVersionCode() {
      def Properties versionProps = new Properties()
      versionProps.load(new FileInputStream(project.versionPropsFile))
      def code = versionProps['artifactReleaseVersionCode'].toInteger()
      return code
  }
  
  def getDevVersionCode() {
      def Properties versionProps = new Properties()
      versionProps.load(new FileInputStream(project.versionPropsFile))
      def code = versionProps['artifactDebugVersionCode'].toInteger()
      return code
  }
  
  buildscript {
      repositories {
          maven { url 'https://maven.fabric.io/public' }
      }
  
      dependencies {
          classpath 'io.fabric.tools:gradle:1.+'
      }
  }
  
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  
  repositories {
      maven { url 'https://maven.fabric.io/public' }
  }
  
  android {
      compileSdkVersion 24
      buildToolsVersion "24.0.0"
  
      defaultConfig {
          applicationId "com.senic.nuimoapp"
          minSdkVersion 18
          targetSdkVersion 23
          versionName getVersionName()
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
          debug {
              applicationIdSuffix ".debug"
              versionNameSuffix "-" + getBuildNumber() + "-DEBUG"
          }
      }
      productFlavors {
          dev {
              versionCode getDevVersionCode()
          }
          prod {
              versionCode getReleaseVersionCode()
          }
      }
      packagingOptions {
          exclude 'META-INF/LICENSE.txt'
          exclude 'META-INF/NOTICE.txt'
          exclude 'META-INF/beans.xml'
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:24.0.0'
      compile 'com.android.support:design:24.0.0'
      compile 'com.android.support:support-v4:24.0.0'
      compile 'com.android.support:recyclerview-v7:24.0.0'
      compile 'com.google.android.gms:play-services-appindexing:9.2.0'
      // View binder
      compile 'com.jakewharton:butterknife:7.0.1'
      // DB and ORM
      compile 'com.j256.ormlite:ormlite-core:4.48'
      compile 'com.j256.ormlite:ormlite-android:4.48'
      // Json parser
      compile 'org.immutables:gson:2.1.14'
      // Nuimo sdk
      compile 'com.senic:nuimo-android:0.5.1'
      compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.0'
  //    compile project(':..:nuimo-android:nuimo')
      // Bug tracker
      compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
          transitive = true;
      }
      testCompile 'junit:junit:4.12'
      // LIFX Lan SDK
      compile 'com.github.getsenic:lifx-sdk-android:0.5.11@aar'
      // Philips Hue SDK
      compile files('libs/huelocalsdk.jar')
      compile files('libs/huesdkresources.jar')
      // OTA firmware update library
      compile 'no.nordicsemi.android:dfu:0.6.3'
      // Rest helper library
      compile 'com.squareup.retrofit2:retrofit:2.1.0'
      compile 'com.squareup.retrofit2:converter-gson:2.1.0'
      // Upnp Library for Sonos or Raumfeld
      compile files('libs/cling-core-2.1.0.jar')
      compile files('libs/cling-support-2.1.0.jar')
      compile files('libs/seamless-http-1.1.1.jar')
      compile files('libs/seamless-util-1.1.1.jar')
      compile files('libs/seamless-xml-1.1.1.jar')
      compile 'org.eclipse.jetty:jetty-server:8.1.19.v20160209'
      compile 'org.eclipse.jetty:jetty-client:8.1.19.v20160209'
      compile 'org.eclipse.jetty:jetty-servlet:8.1.19.v20160209'
      compile 'org.slf4j:slf4j-jdk14:1.7.20'
      // Custom color picker (for Lifx and Philips Hue)
      compile 'com.larswerkman:HoloColorPicker:1.5'
  }
  </code></pre>