2

Does anyone notice the app takes much longer time to start up using Android Plugin for Gradle 2.2.0?

I tried switching between 2.1.3 and 2.2.0 to check the boot performance. Version 2.1.3 always serving up the Activity almost instantly whereas version 2.2.0 always take seconds to load.

classpath 'com.android.tools.build:gradle:2.1.3'    // App boot-up fast
classpath 'com.android.tools.build:gradle:2.2.0'    // App boot-up slow

Test environment

  • Device: Nexus 5
  • Android version: Marshmallow (6.0.1)
  • Project: simply creates a new project with Navigation Drawer Activity template and run it

Project gradle configuration

compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
    applicationId "com.test.sample"
    minSdkVersion 21
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}

Question

Why (and how) would Android Plugin for Gradle affects app performance other than build performance?

LightYearsBehind
  • 1,686
  • 18
  • 24

1 Answers1

1

This is already answered on this link please look here. It will solve your problem. Just follow this steps

Settings/Preferences(Mac) → Build, Execution, Deployment → Instant Run and uncheck Instant Run
Community
  • 1
  • 1
Anant Shah
  • 3,744
  • 1
  • 35
  • 48
  • Alright, this is the 2nd issue I had with Instant Run. Gonna disable it for good. Thank you. – LightYearsBehind Sep 20 '16 at 09:30
  • By the way, I want to note that Instant Run may not be the real culprit behind this, just disabling it solved my problem (same as if I chose to use gradle plugin 2.1.3 instead). Perhaps the plugin developers and Instant Run developers are also fighting among themselves in Google. – LightYearsBehind Sep 20 '16 at 09:40
  • @LightYearsBehind You can accept answer, it solved your problem and what was the first issue you faced with instant run? – Anant Shah Sep 20 '16 at 10:16
  • Alright, this [comment on Reddit](https://www.reddit.com/r/androiddev/comments/4m2v25/instant_run_causing_incredibly_long_app_start/d3s9iox) provides the explanation for this answer. – LightYearsBehind Sep 22 '16 at 00:28