Nativescript Angular project Build failed - android

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'

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.

Related

Build Android Fail when using cordova-plugin-mfp-push

Plugin Version : 8.0.2021062405
When ever i run ionic cordova build android with cordova-plugin-mfp-push plguin installed i am getting the below error mentioned.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\anis.khalfaoui\Desktop\ProxymProjects\kgoc-frontend\platforms\android\app\build.gradle' line: 102
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all artifacts for configuration 'classpath'.
> Could not resolve com.android.tools.build:gradle:+.
Required by:
unspecified:unspecified:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://dl.bintray.com/kotlin/kotlin-eap/com/android/tools/build/gradle/maven-metadata.xml. > Could not get resource 'https://dl.bintray.com/kotlin/kotlin-eap/com/android/tools/build/gradle/maven-metadata.xml'.
> Could not GET 'https://dl.bintray.com/kotlin/kotlin-eap/com/android/tools/build/gradle/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* 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 1m 15s
C:\Users\anis.khalfaoui\Desktop\ProxymProjects\kgoc-frontend\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
this is the line 102 in Build file 'C:\Users\anis.khalfaoui\Desktop\ProxymProjects\kgoc-frontend\platforms\android\app\build.gradle'
apply from: "../cordova-plugin-mfp-push/ibm-build-extras.gradle"
As you see in error message, you have provided + for com.android.tools.build:gradle version in build.gradle file.
Please provide complete version like com.android.tools.build:gradle:4.0.0.
That should resolve your issue.
Thanks

Could not resolve com.google.android.gms:play-services-ads-identifier:12.0.1

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-ads-identifier:12.0.1.
Required by:
project :app
> Skipped due to earlier error
> Could not resolve com.google.android.gms:play-services-ads-identifier:12.0.1.
Required by:
project :app > com.onesignal:OneSignal:3.15.3
> Skipped due to earlier error
* 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 3m 7s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
I face this error 1 week please help me everyone my project was build from flutter 1.2.3
and I need to upgrade it because currently it's not working the problem is onesignal and firebase version not fit. Please give me any answer I need to complete this for my company I just in flutter internship

How to solve "Could not determine the dependencies of task ':app:compileReleaseKotlin'." in flutter

I try to build my flutter project, last month it was fine when I was doing flutter build apk but when I do flutter build apk for now.. I get this error log
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseKotlin'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-location:16.+.
Required by:
project :app > project :location
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. 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 21s
and here is build.gradle: https://gist.github.com/wahyu-handayani/b38f1cc491816c6dcfeb130ab42cdbef
and build.gradle inside android folder:
https://gist.github.com/wahyu-handayani/2ab88f81869ef9a0e1575a465847e608
is there a way to solve this ?

Problem with cordova emulate android and Gradle

I'm new in android apps development. I created a new ionic project. When I try in the console cordova emualte android it fails with this errors:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.3.0.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
* 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 1m 7s
I try curl https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom in the console and worked.
Thanks for any help!!

Flutter Development (flutter-dev) › Need emergency help.... I can't run flutter app in android device and can't build apk due to gradle issue

enter image description here
****When I run these bellow things are shown:**** this issue is occurring with all form Bangladesh
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.
Required by:
project :app
> Could not resolve io.flutter:flutter_embedding_debug:1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.
> Could not get resource
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32/x86_64_debug-1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.pom'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_64_debug/1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32/x86_64_debug-1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.pom'.
> Remote host closed connection during handshake
* Try:
Run with --stack trace 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 1m 41s
Exception: Gradle task assembly debug failed with exit code 1
It clearly says
Could not GET ...
Remote host closed connection during handshake
Maybe, check if your internet connection is available to the application who is trying to build.

Categories

Resources