Generate .apk from command promt

I have to build my android studio project through command line. When i searched i get to kow i have to install gradle and set some environment variable. After doing all this i am getting errors when running command gradlew.bat assembleDebbug . The error that i am getting is:
Could not resolve all dependencies for configuration path ':classpath’
Could not resolve

Please help

This is typically caused by some kind of network error when attempting to download the dependency. Are you perhaps behind a proxy server? You get some more details by running with the --stacktrace option.

mark_vieira : Thanks for the response. I just checked by pinging and i am not able to reach server. Now i am just getting my proxies done with network team and get back with further progress.

I gave proxies to cmd prmt and android studio as well .But i am still facing the same issues.
major issue that i forgot to list is:

connection to https // refused

Please help.

Running Gradle from the command line won’t use the configuration from Android studio. Take a look at the Gradle User Guide for information on configuring proxy settings.

I configured the proxy according to the user guide, but still same error is coming. I just want to build android studio project using command line. Can you please tell me the step - by - step process to achieve this task.