0

i just crate a simple Nativescript-angular project by:

ns create example-app --ng

and when i run that by:

ns run android

i get this error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'core'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:7.1.2.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:7.1.2.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/7.1.2/gradle-7.1.2.pom'. Received status code 403 from server: Forbidden
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.0/kotlin-gradle-plugin-1.6.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.6.0/kotlin-gradle-plugin-1.6.0.pom'. Received status code 403 from server: Forbidden

* 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 2s
Failed to build plugin @nativescript/core :
Error: Command gradlew.bat failed with exit code 1

how can i solve this?

regards'

goldax
  • 71
  • 6
  • Try doing something people tried here but for your own version: https://stackoverflow.com/questions/49505245/could-not-find-com-android-tools-buildgradle4-4 – José Lourenço Apr 06 '22 at 20:52
  • thanks @josé-lourenço but seems not my answer and not work for me! – goldax Apr 07 '22 at 06:21
  • It doesn' seem like ns issue at all, seems like a miss configuration on android settings. I'd recommend to search about these Could not GET "etc.." – José Lourenço Apr 07 '22 at 11:20

1 Answers1

1

finally, I find the reason. google and gradle put some countries to ban list, so some of files and packages from they can't download without VPN. I solve this issue just by buying a VPN account.

goldax
  • 71
  • 6