0

In my android app, it takes approximately more than 3 minutes to build the app. If I browse through the build tasks one by one, I noticed that app:lintDebug takes the considerable amount of minutes (more than 1 minute)

It is quite annoying and i was aware to disable lint check , by putting these settings

lintOptions {
    tasks.lint.enabled = false
    quiet false
    abortOnError false
    ignoreWarnings false
    warningsAsErrors true
    checkReleaseBuilds false
}

Also in the top of the file

tasks.whenTaskAdded { task ->
    if (task.name == "lint") {
        task.enabled = false
    }
}

Also I have checked the offline Gradle build aswel.

But yet

enter image description here

Is there any others settings that i need to put to stop this?

Mr.G
  • 1,275
  • 1
  • 18
  • 48

3 Answers3

1

Actually build time depends on your module count. I give you some advice which use on my project(7 module)

  • Disable Instant Run.
  • Configure Gradle and here
  • If you use DexGuard or ProGuard, turn off while debug build.
  • If you use Crashlytics, check library version. It may be cause negative effect.
Cagdas
  • 101
  • 2
  • 9
0

Try to work on offline mode after adding dependencies.If you want to add more dependencies just disable offline mode add dependency and then again enable offline mode. This will save a lot of your build time.I am working on a large project where build time on online mode is almost an hour while on offline mode it took some minutes to build.

To enable or disable offline mode go to: 

 -> File
 -> Settings 
 -> Build,Execution,Development -> Gradle
 -> Checked or unchecked offline work
Muhammad Zahab
  • 1,049
  • 10
  • 21
  • Already its in offline mode, my question is why does the lint checks even if its disabled . Updated the question. – Mr.G Dec 20 '18 at 05:56
0

Finally i got it done by using a different task name , the gradle build for lint check has placed as lintDebug instead of lint updated skipping lint check should placed as follow

tasks.whenTaskAdded { task ->
    if (task.name == "lintDebug") {
        task.enabled = false
    }
}
Mr.G
  • 1,275
  • 1
  • 18
  • 48