61
tahnik
7y

Google should pay us for every second we waste by running a Gradle build in Android Studio.

Comments
  • 3
    Legit just spend way too long fighting with gradle..
  • 2
    That's absolutely true :D
    Anyway They say the next version of gradle will be faster... hope its true
  • 0
    @Pythoneer lool 😂
    did your kids ever witnessed the build?
  • 1
    @Pythoneer That's a damn funny comment 😂.
    Anyway,gradle daemon is a bit faster
  • 0
    @bdhobare what is that ?
  • 3
    @codeBoy Gradle daemon is a long running process is the background.It can improve build times because of 2 reasons:
    1. You don't have to wake up the JVM each time you build
    2.The project is cached in memory, therefore subsequent builds build upon previous previous
  • 0
    @bdhobare thats good... how can i use that ?
  • 1
    @bdhobare unfortunately our project was using multiDex. That slowed down the build.
  • 1
    @tahnik yeah ,i agree ,multi dex is slow af.
  • 3
    @codeBoy To use gradle daemon
    -go to /home/username/.gradle
    -open or create a file gradle.properties
    - Add this line to the file "org.gradle.daemon=true"

    Next time you build, gradle will use the daemon.
    However it usually stops after a long time of not using it.(like 3 hours)
  • 0
    @bdhobare thanks dear for your help:)

    I read that gradle builds can be done also from command line using a gradle script in the project folder
    Would that be faster or this is irrelevant ?
  • 2
    @codeBoy Yea.. you can build from the terminal.Go to your project root and type ./gradlew <task>
    You can find tasks with gradlew tasks.

    IMO.. executing from the terminal doesn't have any extraordinary advantages.In fact it's harder to deploy your app that way.
  • 0
    @bdhobare you are a very helpful guy ☺ thanks my friend
Add Comment