Hello, I hope I have quite simple problem which I ...
# community-support
m
Hello, I hope I have quite simple problem which I didn't find anything in the documentation. I got exception as seen below which is most propably caused by some network error. This happens only on CI server, so one option is retry whole build in that case. But is there any way how to set "retry" properties for dependencyResolutionManagement / repositories in those cases? Thank you
Copy code
Configuration cache state could not be cached: field `__projectRuntimeLintModelsFileCollection__` of `com.android.build.gradle.internal.lint.AndroidArtifactInput` bean found in field `__mainArtifact__` of `com.android.build.gradle.internal.lint.VariantInputs` bean found in field `__variantInputs__` of task `:shared:resource:generateDebugLintModel` of type `com.android.build.gradle.internal.lint.LintModelWriterTask`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'
> Could not resolve all files for configuration ':shared:resource:debugRuntimeClasspath'.
   > Could not resolve androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.5.
     Required by:
         project :shared:resource > org.jetbrains.compose.ui:ui:1.7.0 > androidx.compose.ui:ui:1.7.1 > androidx.compose.ui:ui-android:1.7.1 > androidx.activity:activity-ktx:1.7.0
      > Could not resolve androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.5.
         > Could not get resource '<https://maven.google.com/androidx/lifecycle/lifecycle-viewmodel-ktx/2.8.5/lifecycle-viewmodel-ktx-2.8.5.pom>'.
            > Could not HEAD '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-ktx/2.8.5/lifecycle-viewmodel-ktx-2.8.5.pom>'.
               > Connection reset
> There is 1 more failure with an identical cause.
j
I don't think this can be done directly with Gradle. Usually what is used with CI servers is a reasonably local deployment of a proxy/cache of the remote repositories. Some proxies may be configured to make several attempts to fetch a remote (new) artifact before giving up, though that's usually not needed.
👆 1
note that you may run into other issues directly using the public repositories in your CI, such as rate limiting
m
You're totally correct. But it requires lot of time vs edit some properties. Anyways thank you for help it looks like we will need to go this way.
l
FYI, the number of retries to connect to a repo is hardcoded at 3 and cannot be changed (no public APIs). A remote cache, local mirror, or some kind of save and restore of this dependency is the only way to go.