Tns run android build failed

android

#1

Hello!

I’m trying to run the Groceries app locally, on linux ubuntu 18.04, building for android, but i’m getting the following error after I run tns run android:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.android.support:multidex:1.0.2.
  Required by:
      project :app
   > Could not resolve com.android.support:multidex:1.0.2.
      > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/multidex/1.0.2/multidex-1.0.2.pom'.
         > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/multidex/1.0.2/multidex-1.0.2.pom'.
            > Connect to dl.google.com:443 [dl.google.com/172.217.29.174, dl.google.com/2800:3f0:4001:806:0:0:0:200e] failed: A rede está fora de alcance (connect failed)
   > Could not resolve com.android.support:multidex:1.0.2.
      > Could not get resource 'https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex-1.0.2.pom'.
         > Could not GET 'https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex-1.0.2.pom'.
            > Connect to jcenter.bintray.com:443 [jcenter.bintray.com/52.25.156.79, jcenter.bintray.com/34.212.249.79] failed: Conexão recusada (Connection refused)

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

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
Unable to apply changes on device: 0041145115. Error is: Command ./gradlew failed with exit code 1.

tns --version
4.1.2

node --version
v8.8.0

npm --version
5.4.2

For android, I have build tools 27.0.3, platform android-27 already installed.

My phone is a MOTOROLA MOTO Z2 PLAY running Android Oreo.

Can someone help me?

tns doctor
:heavy_check_mark: Getting environment information

No issues were detected.
:heavy_check_mark: Your ANDROID_HOME environment variable is set and points to correct directory.
:heavy_check_mark: Your adb from the Android SDK is correctly installed.
:heavy_check_mark: The Android SDK is installed.
:heavy_check_mark: A compatible Android SDK for compilation is found.
:heavy_check_mark: Javac is installed and is configured properly.
:heavy_check_mark: The Java Development Kit (JDK) is installed and is configured properly.
:heavy_check_mark: Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
:heavy_check_mark: Getting NativeScript components versions information…
:heavy_check_mark: Component nativescript has 4.1.2 version and is up to date.
:heavy_check_mark: Component tns-core-modules has 4.1.0 version and is up to date.
:heavy_check_mark: Component tns-android has 4.1.3 version and is up to date.
:heavy_multiplication_x: Component tns-ios is not installed.


#2

Sorry, guys, the problem was my proxy.


#3

@thiagoufg I have same issues, please give me more detail to fix it, thks