Helloworld build failed on windows for Android


I am starting with hello world example to learn nativescript.
I am compiling and building code behind corporate explicit proxy. I am able to create project and add android platform in my project. but when i try to build the project I face below error. [Gradle]('https://jcenter.bintray.com/com/android/tools/bu ild/gradle-core/2.1.2/gradle-core-2.1.2.jar) is accessible from browser. But “tns build android” or “tns run android” couldn’t download and give error.

Your help will be appreciated.

D:\CurrentProjects\Android\NativeScript\simple>tns run android
Executing before-prepare hook from D:\CurrentProjects\Android\NativeScript\simpl
Preparing project...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'simple'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not download gradle-core.jar (com.android.tools.build:gradle-core:2.1
      > Could not get resource 'https://jcenter.bintray.com/com/android/tools/bu
         > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gr
            > This is usually a temporary error during hostname resolution and m
eans that the local server did not receive a response from an authoritative serv
er (jcenter.bintray.com)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.


Total time: 21.159 secs
Processing node_modules failed. Error: Command D:\CurrentProjects\Android\Native
Script\simple\platforms\android\gradlew.bat failed with exit code 1


As per stackoverflow this problem was solved by gradle but why tns build still face this problem?


If problem persists then I am afraid I have to leave coding in nativescript …And it would be shame as I had invested lot of time coming to this stage…


You can go into your platforms/android folder and manually type gradlew with whatever proxy info you need to have it download gradle properly on your machine. Once you have gradle; then then normal tns command should work properly.

Nathanael A.


Found the answer to setting.