I’m experiencing a build failure when running ./gradlew clean build on my Android project. The error message indicates a problem with the core-location dependency from androidx.core. Here are the details:
Calculating task graph as no cached configuration is available for tasks: clean build
FAILURE: Build failed with an exception.
* What went wrong:
Configuration cache state could not be cached: field `compileTimeDependencies` of task `:app:dataBindingMergeDependencyArtifactsRelease` of type `com.android.build.gradle.internal.tasks.databinding.DataBindingMergeDependencyArtifactsTask`: error writing value of type 'org.gradle.api.internal.artifacts.configurations.ResolutionBackedFileCollection'
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not resolve androidx.core:core-location:1.13.0.
Required by:
project :app
> Could not resolve androidx.core:core-location:1.13.0.
> Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/androidx/core/core-location/1.13.0/core-location-1.13.0.pom'.
> Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/androidx/core/core-location/1.13.0/core-location-1.13.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 3s
Configuration cache entry discarded due to serialization error.
It appears that the build process is attempting to download the core-location dependency from api.mapbox.com, but it is receiving a 403 Forbidden response. I am not sure why it is trying to fetch this dependency from Mapbox or how to resolve this issue.
I have tried the following without success:
Cleaning the project and rebuilding.
Running the build with –stacktrace, –info, and –debug options for more insights.
Any help on how to resolve this issue would be greatly appreciated. Is there a configuration I need to change, or is there an issue with the repository access?
Context:
Gradle version: 8.7,
Android Gradle Plugin version: 8.5.0
Thank you!