Error when compiling for the first time

I have some problems with gradle when compiling a project for the first time:

Starting build…
Creating Idea project model…

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘My Application’.

Could not resolve all files for configuration ‘:classpath’.
Could not find gradle-7.2.1.jar (com.android.tools.build:gradle:7.2.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2.1/gradle-7.2.1.jar
Could not find builder-7.2.1.jar (com.android.tools.build:builder:7.2.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/7.2.1/builder-7.2.1.jar
Could not find sdklib-30.2.1.jar (com.android.tools:sdklib:30.2.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/sdklib/30.2.1/sdklib-30.2.1.jar
Could not find aapt2-proto-7.2.1-7984345.jar (com.android.tools.build:aapt2-proto:7.2.1-7984345).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2-proto/7.2.1-7984345/aapt2-proto-7.2.1-7984345.jar
Could not find builder-model-7.2.1.jar (com.android.tools.build:builder-model:7.2.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder-model/7.2.1/builder-model-7.2.1.jar
Could not download grpc-stub-1.21.1.jar (io.grpc:grpc-stub:1.21.1)
Could not get resource ‘https://plugins.gradle.org/m2/io/grpc/grpc-stub/1.21.1/grpc-stub-1.21.1.jar’.
Could not GET ‘https://jcenter.bintray.com/io/grpc/grpc-stub/1.21.1/grpc-stub-1.21.1.jar’. Received status code 403 from server: Forbidden
Could not find core-proto-0.0.8-alpha07.jar (com.google.testing.platform:core-proto:0.0.8-alpha07).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/google/testing/platform/core-proto/0.0.8-alpha07/core-proto-0.0.8-alpha07.jar
Could not download kotlinx-coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.1)
Could not get resource ‘https://plugins.gradle.org/m2/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.4.1/kotlinx-coroutines-core-jvm-1.4.1.jar’.
Could not GET ‘https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.4.1/kotlinx-coroutines-core-jvm-1.4.1.jar’. Received status code 403 from server: Forbidden
Could not download jakarta.activation-api-1.2.1.jar (jakarta.activation:jakarta.activation-api:1.2.1)
Could not get resource ‘https://plugins.gradle.org/m2/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar’.
Could not GET ‘https://jcenter.bintray.com/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar’. Received status code 403 from server: Forbidden
Could not download auto-value-annotations-1.6.2.jar (com.google.auto.value:auto-value-annotations:1.6.2)
Could not get resource ‘https://plugins.gradle.org/m2/com/google/auto/value/auto-value-annotations/1.6.2/auto-value-annotations-1.6.2.jar’.
Could not GET ‘https://jcenter.bintray.com/com/google/auto/value/auto-value-annotations/1.6.2/auto-value-annotations-1.6.2.jar’. Received status code 403 from server: Forbidden
Could not download error_prone_annotations-2.3.4.jar (com.google.errorprone:error_prone_annotations:2.3.4)
Could not get resource ‘https://plugins.gradle.org/m2/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar’.
Could not GET ‘https://jcenter.bintray.com/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar’. Received status code 403 from server: Forbidden
Could not download jose4j-0.7.0.jar (org.bitbucket.b_c:jose4j:0.7.0)
Could not get resource ‘https://plugins.gradle.org/m2/org/bitbucket/b_c/jose4j/0.7.0/jose4j-0.7.0.jar’.
Could not GET ‘https://jcenter.bintray.com/org/bitbucket/b_c/jose4j/0.7.0/jose4j-0.7.0.jar’. 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.

CONFIGURE FAILED in 43s

As those files it complains about can be downloaded just fine right here, right now, I’d guess there is one of two causes.

Either it was a temporary hickup, just try it again, maybe with --refresh-dependencies if Gradle still remembers that it did not find them.

If it still fails with “403 Forbidden” errors, you most probably have some firewall, proxy, or virus scanner, that blocks your downloads.