Very curious to know, when we build android project by clicking, "Sync project with gradle files", what steps are actually done internally?
Is it a good practice to use offline mode of gradle sync?
Very curious to know, when we build android project by clicking, "Sync project with gradle files", what steps are actually done internally?
Is it a good practice to use offline mode of gradle sync?
In a higher level: when you start syncing, it runs the project build.gradle
and every module's build.gradle
which is included in project's settings.gradle
. It will resolve the dependencies, set up default launch configurations and build flavors, etc. Of course it can be more complex if you have your own tasks which should be run at certain point. By default Android Studio will configure gradle but you can change that anytime.
And regarding the offline mode, it's really useful when you don't have network connection. In this case it will resolve dependencies from the local cache. Custom tasks which require network connection won't compile though.