Problem with cordova emulate android and Gradle - android

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!!

Related

How to solve Could not resolve com.google.android.gms:play-services-location:[15.0.0, 16.0.0). in Flutter

Yesterday I run my code and didn't get any error but just so sudden... (I didn't edit my code) I got an error log like this
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
> Could not resolve com.google.android.gms:play-services-location:[15.0.0, 16.0.0).
Required by:
project :app
> 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 1m 8s
I have tried by running it using another internet connection and still I get the same result. Is there a way to solve this (this error only happen when I run it using android and run so well in ios simulator)

Nativescript Angular project Build failed

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.

Android build issue with 'scan' plugin - Flutter

Android build failing with following exception.
Plugin: scan [https://pub.dev/packages/scan]
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDevReleaseAssets'.
Could not resolve all files for configuration ':app:devReleaseRuntimeClasspath'.
Could not resolve com.huawei.hms:scanplus:2.1.0.300.
Required by:
project :app > project :scan
> Could not resolve com.huawei.hms:scanplus:2.1.0.300.
> Could not get resource 'https://google.bintray.com/exoplayer/com/huawei/hms/scanplus/2.1.0.300/scanplus-2.1.0.300.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/com/huawei/hms/scanplus/2.1.0.300/scanplus-2.1.0.300.pom'. 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 2m 59s
add: maven {url 'http://developer.huawei.com/repo'}
check your build.gradle

when trying run my flutter project get some error

Launching lib/main.dart on Redmi Note 8 in debug mode...
Running Gradle task 'assembleDebug'...
I/flutter ( 5876): The user wants to login with mi and 123
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.google.android.gms:strict-version-matcher-plugin:1.1.0.
Required by:
project : > com.google.gms:google-services:4.2.0
> Could not resolve com.google.android.gms:strict-version-matcher-plugin:1.1.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom'.
> Could not HEAD 'https://dl.google.com/dl/android/maven2/com/google/android/gms/strict-version-matcher-plugin/1.1.0/strict-version-matcher-plugin-1.1.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/216.58.208.142, dl.google.com/2a00:1450:4002:805:0:0:0:200e] failed: Network is unreachable (connect failed)
* 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 4m 34s
Finished with error: Gradle task assembleDebug failed with exit code 1

react-native run-android Could not resolve all dependencies for configuration ':classpath'

I am learing react-native,i got this error when i used command 'react-native run-android' on windows 10
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'demo'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not download gradle-core.jar (com.android.tools.build:gradle-core:1.3.1)
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
> peer not authenticated
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I'm tired,I'll be appreciate for you helping me!

Categories

Resources