IONIC 4 gradle failed - ionic-framework

I'm using IONIC 5.2.4.
when run command ionic cordova build android throw this exception
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.3.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.jar
Required by:
any one help me :-(

Related

Flutter project couldn't resolve ':classpath'

I'm trying to run an app but I encounter this;
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all files for configuration ':classpath'.
Could not find com.google.gms:google-services:4.3.13.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.13/google-services-4.3.13.pom
- https://repo.maven.apache.org/maven2/com/google/gms/google-services/4.3.13/google-services-4.3.13.pom
Required by:
project :
I have put google-services.json in app folders,
I have tried:
gradlew --scan : I got and exception.
Gradle version: 7.4
Plugin version: 3.8.1
Request URL: https://scans-in.gradle.com/scans/publish/gradle/3.8.1/token
Request ID: 518f437c-3ef8-481c-8c00-a1d76826c7a8
Exception: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Request blocked by Privoxy"
I tried using VPN and still did not work
try reinstalling android build tools
and
add this line "systemProp.http.nonProxyHosts=*|localhost"in gradle.properties

I tried running my flutter app on an Emulator and it showed the following error

A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:4.1.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.1.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
> Remote host terminated the handshake
To solve this I open the app in android studio for editing and the artifacts are automatically downloaded.
There might be other workarounds but this works for me.
How to open flutter app for editing?
https://stackoverflow.com/questions/60462318/cant-find-open-for-editing-in-android-studio#:~:text=Got%20to%20your,the%20IDE.%20Source.

hello im try to run my flutter app on my real android phone but give me a lot of errors

Launching lib\main.dart on STK L21 in debug mode...
Running Gradle task 'assembleDebug'...
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:4.1.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.1.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.0/gradle-4.1.0.pom'. Received status code 403 from server: Forbidden
Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
Required by:
project :
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.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 1m 5s
Exception: Gradle task assembleDebug failed with exit code 1
How to Solve Flutter problems: “Could not resolve all artifacts for configuration ':classpath' ” Error?
To Solve Flutter problems: “Could not resolve all artifacts for configuration ':classpath' ” this problem is caused by updating the Gradle. The Android Studio always asks you to update it, but don't do this for flutter apps. I solved it with the following versions On build.gradle module level.
Flutter problems: “Could not resolve all artifacts for configuration ':classpath' ” Error
To Solve Flutter problems: “Could not resolve all artifacts for configuration ':classpath' ” this problem is caused by updating the Gradle. The Android Studio always asks you to update it, but don't do this for flutter apps. I solved it with the following versions On build.gradle module level
please follow this link :https://fluttercorner.com/flutter-problems-could-not-resolve-all-artifacts-for-configuration-classpath/
First You run Flutter Doctor

Could not resolve all artifacts for configuration ':classpath'. Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.2.71

When creating first flutter app, and trying flutter run with android simulator, I get this error:
`A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.2.71.
Required by:
project : > org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
project : > org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71 > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.2.71
Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.2.71.
Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.71/kotlin-reflect-1.2.71.pom'.
Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.71/kotlin-reflect-1.2.71.pom'.
org.apache.http.client.ClientProtocolException (no error message)
Could not resolve org.jetbrains.kotlin:kotlin-reflect:1.2.71.
Required by:
project : > com.android.tools.build:gradle:3.2.1 > com.android.tools.lint:lint-gradle-api:26.2.1
project : > com.android.tools.build:gradle:3.2.1 > com.android.tools.build:builder:3.2.1 > com.android.tools:sdk-common:26.2.1`
flutter doctor seems to be all OK. I am using MacOS
I solved it by installing the latest flutter SDK. There seemed to be a mismatch between the version I had installed (in my case v1.7.8+hotfix.4-stable) and the lastest (which was v1.7.9.1+hotfix.4-stable)

Ionic Android build failed with an exception

I got the following error in the implementation of the Ionic. How do I fix this error?
windows: 10
ionic: 2.2.3
cordova: 6.5.0
Morteza#DESKTOP-ORPCJPP MINGW64 /d/ionic/Morteza (master)
$ ionic run android
> ionic-hello-world#0.0.0 ionic:build D:\ionic\Morteza
> ionic-app-scripts build
ANDROID_HOME=C:\Users\Morteza\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
Subproject Path: CordovaLib
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.2.1.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.2.1.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.1/gradle-2.2.1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/75.126.118.188] 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.
BUILD FAILED
Total time: 25.67 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
Try this:
Into your android sdk find sdk manager.
open sdk manager with Run as administrator.
now download android sdk build tools matching version with your ionic
also download android api->sdk platform matching version with your ionic