I am trying to build a Dart application to run it on an android emulator device. The problems is that i get the following error code:
> Could not resolve com.android.tools.ddms:ddmlib:30.3.0.
Required by:
project : > com.android.tools.build:gradle:7.3.0
project : > com.android.tools.build:gradle:7.3.0 > com.android.tools:sdk-common:30.3.0
project : > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder-test-api:7.3.0
project : > com.android.tools.build:gradle:7.3.0 > com.android.tools.build:builder:7.3.0
> Could not resolve com.android.tools.ddms:ddmlib:30.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/ddms/ddmlib/30.3.0/ddmlib-30.3.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/ddms/ddmlib/30.3.0/ddmlib-30.3.0.pom'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
> Invalid CertificateVerify signature
> Could not resolve com.android.tools.utp:android-test-plugin-host-coverage-proto:30.3.0.
Required by:
project : > com.android.tools.build:gradle:7.3.0
> Could not resolve com.android.tools.utp:android-test-plugin-host-coverage-proto:30.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-coverage-proto/30.3.0/android-test-plugin-host-coverage-proto-30.3.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/utp/android-test-plugin-host-coverage-proto/30.3.0/android-test-plugin-host-coverage-proto-30.3.0.pom'.
> Tag mismatch!
* 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 9s
[!] Gradle threw an error while downloading artifacts from the network.
What i have tried so far:
I added “systemProp.javax.net.ssl.protocols=TLSv1.2,TLSv1.3” into gradle.properties
I activated TLS 1.3 (running Win 10 Pro)
Deleted the .gradle folder on the C: Drive.
Added mavenCentral repo to build.gradle
Checked the distributionUrl in gradle-wrapper.properties.
I have no clue what else to try or if i might have missed something.
I put a fresh install of Java and oraclejdk on my PC and am still getting the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
> Could not download builder-7.3.0.jar (com.android.tools.build:builder:7.3.0)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/7.3.0/builder-7.3.0.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/7.3.0/builder-7.3.0.jar'.
> Tag mismatch!
> Could not download sdk-common-30.3.0.jar (com.android.tools:sdk-common:30.3.0)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.3.0/sdk-common-30.3.0.jar'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/sdk-common/30.3.0/sdk-common-30.3.0.jar'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.3/userguide/build_environment.html#gradle_system_properties
> Invalid CertificateVerify signature
* 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 25s
[!] Gradle threw an error while downloading artifacts from the network.
Exception: Gradle task assembleDevDebug failed with exit code 1
I am on Windows so therefore i tried “/gradlew --verison” which does not exist on my installation. I do not have gradle installed manually. I am using the gradle version that android studio is installing for me. as far as i was able to check inside the “.gradle” folder on C: drive, i do have “gradle-7.3-all” and “gradle-7.6-bin”. I guessing that both are not completely downloaded and installed.
I have checked in systemvariables that the oracle jdk 21 is set correctly. I then restarted my Computer, tried again and got the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':gradle:compileGroovy'.
> Could not resolve all files for configuration ':gradle:compileClasspath'.
> Could not resolve com.android.tools.build:gradle:7.3.0.
Required by:
project :gradle
> Could not resolve com.android.tools.build:gradle:7.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom'.
> Tag mismatch!
* 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 1s
[!] Gradle threw an error while downloading artifacts from the network.
Exception: Gradle task assembleDebug failed with exit code 1
I am on Windows so therefore i tried “/gradlew --verison”
That is nowhere correct.
How to call it depends on the shell you use.
For example on CMD it is gradlew, on PWSH it is ./gradlew or .\gradlew, on Git Bash it is ./gradlew.
which does not exist on my installation. I do not have gradle installed manually.
And you don’t need it, I never have Gradle installed, but any sane Gradle project should have the four Gradle wrapper files installed that you should use to run the build.
I am using the gradle version that android studio is installing for me. as far as i was able to check inside the “.gradle” folder on C: drive, i do have “gradle-7.3-all” and “gradle-7.6-bin”. I guessing that both are not completely downloaded and installed.
If you run Gradle from AS, open the Gradle settings dialog to check which Java you use to run Gradle builds and make sure you there use your newly installed Java and make sure it is one that is compatible with the Gradle version you run that should be defined in gradle/wrapper/gradle-wrapper.properties. You find the compatibility matrix at Compatibility Matrix.
I have checked in systemvariables that the oracle jdk 21 is set correctly. I then restarted my Computer, tried again and got the following error:
What is configured in Windows is not necessarily relevant, it depends on what you selected in the Gradle settings as mentioned.
I uninstalled jdk 21 and installed jdk 17. I made sure, that jdk 17 is being used. Regarding the gradle command i have also tried gradlew in CMD (forgot to mention it). CMD does not recognize any gradlew commands. Regarding AS i am using only the emulator of AS and the developing part is in VSC (sorry for the misunderstanding on my side). I installed in VSC all needed extensions (dart, flutter, java for Gradle). I don’t know if I forgot something but heres my new error code:
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve io.flutter:x86_debug:1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091.
Required by:
project :app
> Could not resolve io.flutter:x86_debug:1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091.
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091/x86_debug-1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091.pom'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/x86_debug/1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091/x86_debug-1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091.pom'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.5/userguide/build_environment.html#gradle_system_properties
> Invalid CertificateVerify signature
> Could not resolve androidx.fragment:fragment:1.1.0.
Required by:
project :app > io.flutter:flutter_embedding_debug:1.0.0-54a7145303f0dd9d0f93424a2e124eb4abef5091
> Could not resolve androidx.fragment:fragment:1.1.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/androidx/fragment/fragment/1.1.0/fragment-1.1.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/androidx/fragment/fragment/1.1.0/fragment-1.1.0.pom'.
> Tag mismatch!
* 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 33s
[!] Gradle threw an error while downloading artifacts from the network.
Exception: Gradle task assembleDebug failed with exit code 1
P.S. i am new to developing in generell, that’s why I’m sorry that I may make “obvious” mistakes
Regarding the gradle command i have also tried gradlew in CMD (forgot to mention it). CMD does not recognize any gradlew commands.
It is part of your project, right at the root.
You have to call it from there.
If it is not part of your project, the project imho has a build bug as practically each and every Gradle project should have the 4 wrapper files. https://docs.gradle.org/current/userguide/gradle_wrapper.html
You could also add --scan to the Gradle call, also from the IDE and then look at the Build Scan.
If you are now really using that freshly installed Java 17 and it still comes, try to download the shown URL from your Browser.
If that works, do you maybe have some proxy / need some proxy to access the internet and did not configure it for Gradle?
Or maybe some firewall or anti-virus that is breaking things?