gpt4 book ai didi

android - Microsoft Azure DevOps Pipeline 失败,Gradle Android 中出现连接重置错误

转载 作者:行者123 更新时间:2023-12-03 03:48:46 25 4
gpt4 key购买 nike

我在 MS Azure DevOps 中运行 CI 管道,该管道总是失败并出现相同的错误。

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':feature-onboarding:kaptGenerateStubsDebugKotlin'.
> Could not resolve all files for configuration ':feature-onboarding:DebugCompileClasspath'.
> Could not download okio-1.17.4.jar (com.squareup.okio:okio:1.17.4)
> Could not get resource 'https://jcenter.bintray.com/com/squareup/okio/okio/1.17.4/okio-1.17.4.jar'.
> Could not GET 'https://jcenter.bintray.com/com/squareup/okio/okio/1.17.4/okio-1.17.4.jar'.
> Connection reset

我尝试了多种方法:

  1. 将内存大小增加至 8GB
  2. 向 gradle.properties 文件添加额外属性:
org.gradle.internal.http.connectionTimeout=300000
org.gradle.internal.http.socketTimeout=300000
org.gradle.internal.repository.max.retries=10
org.gradle.internal.repository.initial.backoff=500
  • 运行 macOS-10.15、macOS-10.14、macOS 最新版
  • 在没有守护进程的情况下运行 gradleW
  • 额外:使用的单元测试模板:

    parameters:
    gradleCommand: 'testDebugUnitTest'

    steps:
    - task: Gradle@2
    displayName: 'Run Tests'
    inputs:
    workingDirectory: ''
    gradleWrapperFile: 'gradlew'
    gradleOptions: '-Xmx8192m'
    publishJUnitResults: false
    testResultsFiles: '**/TEST-*.xml'
    tasks: '${{ parameters.gradleCommand }} --no-daemon --no-parallel --stacktrace'

    但它们似乎都不起作用,并且错误仍然存​​在。我们如何解决这个问题?

    最佳答案

    以防万一它是相关的 - 尽量不要使用 JCenter,不要在 Maven Central 之前使用

    Jfrog 逐渐离开 JCenter,这会导致问题,特别是对于 Azure DevOps 管道。

    我更改了存储库的顺序,首先检查 Maven Central,然后才检查 JCenter,它解决了问题。

    https://onesignal.com/blog/android-migrate-jcenter-to-maven-central/

    关于android - Microsoft Azure DevOps Pipeline 失败,Gradle Android 中出现连接重置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67919084/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com