Caching gradle bundle for faster builds

Approach 01

Step 01

 Go to C:\Users\<username>\.gradle\wrapper\dists/<your_gradle_version>


Step 02

Copy that path


Step 03

Inside your project explorer, go to android > gradle > wrapper > gradle-wrapper.properties


Step 04

In the distribution Url, change to the following

distributionUrl=C:\Users\thetnswe\.gradle\wrapper\dists\gradle-5.6.2-all\9st6wgf78h16so49nn74lgtbb\gradle-5.6.2-all.zip


Approach  02

Add the following command at the line 75 of gradlew.bat file located at  > android > gradlew

--offline @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% --offline


Add --offline at the end of the following lines at the end of the file

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" --offline


Final Approach

Make local download link

and assign that link to distributionUrl

Comments

Popular posts from this blog

Publishing Flutter app

Solving flutter web app CORS policy

Flutter app crashing without any logs when building in debug mode.