Hi. Build on Xcode Cloud fails with `Could not GET...
# compose-ios
g
Hi. Build on Xcode Cloud fails with
Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-iosarm64/2.9.0-alpha03/lifecycle-viewmodel-iosarm64-2.9.0-alpha03.klib>'.
Am I only one?
Copy code
Showing All Issues
=== BUILD TARGET iosApp OF PROJECT iosApp WITH CONFIGURATION Release ===
note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'iosApp' from project 'iosApp')
warning: Run script build phase 'Compile Kotlin Framework' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'iosApp' from project 'iosApp')
warning: Run script build phase 'upload dsyms' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'iosApp' from project 'iosApp')

Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone

Run script build phase 'Compile Kotlin Framework' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.

Run script build phase 'upload dsyms' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.

PhaseScriptExecution Compile\ Kotlin\ Framework /Volumes/workspace/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/iosApp/IntermediateBuildFilesPath/iosApp.build/Release-iphoneos/iosApp.build/Script-F36B1CEB2AD83DDC00CB74D5.sh (in target 'iosApp' from project 'iosApp')
    cd /Volumes/workspace/repository/iosApp
    /bin/sh -c /Volumes/workspace/DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/iosApp/IntermediateBuildFilesPath/iosApp.build/Release-iphoneos/iosApp.build/Script-F36B1CEB2AD83DDC00CB74D5.sh

Downloading <https://services.gradle.org/distributions/gradle-8.12-bin.zip>
.............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%
note: [ksp] loaded provider(s): [androidx.room.RoomKspProcessor$Provider, org.koin.compiler.BuilderProcessorProvider]
warning: [ksp] /Volumes/workspace/repository/data/src/commonMain/kotlin/cache/session/dto/ClickEntity.kt:18: sessionId column references a foreign key but it is not part of an index. This may trigger full table scans whenever parent table is modified so you are highly advised to create an index that covers this column.
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Done.
Extracting dependency: /Users/local/.konan/dependencies/cache/llvm-16.0.0-x86_64-macos-essentials-50.tar.gz into /Users/local/.konan/dependencies
Done.
Extracting dependency: /Users/local/.konan/dependencies/cache/libffi-3.2.1-3-darwin-macos.tar.gz into /Users/local/.konan/dependencies
/Volumes/workspace/repository/data/build/generated/ksp/iosArm64/iosArm64Main/kotlin/com/my/app/data/cache/room/AppDatabaseConstructor.kt:5:8: warning: 'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: <https://youtrack.jetbrains.com/issue/KT-61573>
/Volumes/workspace/repository/data/src/commonMain/kotlin/cache/room/Room.kt:13:1: warning: 'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: <https://youtrack.jetbrains.com/issue/KT-61573>
note: [ksp] loaded provider(s): [org.koin.compiler.BuilderProcessorProvider]
error: Connection reset by peer
error: Connection reset by peer
error: Connection reset by peer

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':composeApp:kspKotlinIosArm64'.
> Could not resolve all files for configuration ':composeApp:iosArm64CompileKlibraries'.
   > Could not download lifecycle-viewmodel.klib (androidx.lifecycle:lifecycle-viewmodel-iosarm64:2.9.0-alpha03)
      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-iosarm64/2.9.0-alpha03/lifecycle-viewmodel-iosarm64-2.9.0-alpha03.klib>'.
         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-iosarm64/2.9.0-alpha03/lifecycle-viewmodel-iosarm64-2.9.0-alpha03.klib>'.
            > Got socket exception during request. It might be caused by SSL misconfiguration
               > Connection reset by peer
   > Could not download lifecycle-runtime.klib (androidx.lifecycle:lifecycle-runtime-iosarm64:2.9.0-alpha03)
      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime-iosarm64/2.9.0-alpha03/lifecycle-runtime-iosarm64-2.9.0-alpha03.klib>'.
         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime-iosarm64/2.9.0-alpha03/lifecycle-runtime-iosarm64-2.9.0-alpha03.klib>'.
            > Got socket exception during request. It might be caused by SSL misconfiguration
               > Connection reset by peer
   > Could not download lifecycle-common.klib (androidx.lifecycle:lifecycle-common-iosarm64:2.9.0-alpha03)
      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common-iosarm64/2.9.0-alpha03/lifecycle-common-iosarm64-2.9.0-alpha03.klib>'.
         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common-iosarm64/2.9.0-alpha03/lifecycle-common-iosarm64-2.9.0-alpha03.klib>'.
            > Got socket exception during request. It might be caused by SSL misconfiguration
               > Connection reset by peer

* 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 5m 27s

Downloading <https://services.gradle.org/distributions/gradle-8.12-bin.zip>

.............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%

[ksp] loaded provider(s): [androidx.room.RoomKspProcessor$Provider, org.koin.compiler.BuilderProcessorProvider]

Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.

Done.

Extracting dependency: /Users/local/.konan/dependencies/cache/llvm-16.0.0-x86_64-macos-essentials-50.tar.gz into /Users/local/.konan/dependencies

Done.

Extracting dependency: /Users/local/.konan/dependencies/cache/libffi-3.2.1-3-darwin-macos.tar.gz into /Users/local/.konan/dependencies

[ksp] /Volumes/workspace/repository/data/src/commonMain/kotlin/cache/session/dto/ClickEntity.kt:18: sessionId column references a foreign key but it is not part of an index. This may trigger full table scans whenever parent table is modified so you are highly advised to create an index that covers this column.

'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: <https://youtrack.jetbrains.com/issue/KT-61573>

'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. You can use -Xexpect-actual-classes flag to suppress this warning. Also see: <https://youtrack.jetbrains.com/issue/KT-61573>

[ksp] loaded provider(s): [org.koin.compiler.BuilderProcessorProvider]

Connection reset by peer

Connection reset by peer



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':composeApp:kspKotlinIosArm64'.

> Could not resolve all files for configuration ':composeApp:iosArm64CompileKlibraries'.

   > Could not download lifecycle-viewmodel.klib (androidx.lifecycle:lifecycle-viewmodel-iosarm64:2.9.0-alpha03)

      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-iosarm64/2.9.0-alpha03/lifecycle-viewmodel-iosarm64-2.9.0-alpha03.klib>'.

         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-viewmodel-iosarm64/2.9.0-alpha03/lifecycle-viewmodel-iosarm64-2.9.0-alpha03.klib>'.

            > Got socket exception during request. It might be caused by SSL misconfiguration

               > Connection reset by peer

   > Could not download lifecycle-runtime.klib (androidx.lifecycle:lifecycle-runtime-iosarm64:2.9.0-alpha03)

      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime-iosarm64/2.9.0-alpha03/lifecycle-runtime-iosarm64-2.9.0-alpha03.klib>'.

         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime-iosarm64/2.9.0-alpha03/lifecycle-runtime-iosarm64-2.9.0-alpha03.klib>'.

            > Got socket exception during request. It might be caused by SSL misconfiguration

               > Connection reset by peer

   > Could not download lifecycle-common.klib (androidx.lifecycle:lifecycle-common-iosarm64:2.9.0-alpha03)

      > Could not get resource '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common-iosarm64/2.9.0-alpha03/lifecycle-common-iosarm64-2.9.0-alpha03.klib>'.

         > Could not GET '<https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common-iosarm64/2.9.0-alpha03/lifecycle-common-iosarm64-2.9.0-alpha03.klib>'.

            > Got socket exception during request. It might be caused by SSL misconfiguration

               > Connection reset by peer



* 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 5m 27s

Connection reset by peer
➕ 1
t
Hi @Giorgi, did you figure this out? It seems network stops working after some time.
g
nope. you could try to somehow cache the downloaded libraries, but I could not make this work, I just gave up.
c
I have a workaround. Add this to your gradle.properties inside the Xcode Cloud build:
Copy code
systemProp.java.net.preferIPv4Stack=true
systemProp.java.net.preferIPv6Addresses=false
org.gradle.parallel=false
org.gradle.tooling.parallel=false
org.gradle.workers.max=1
The downside is that this will make the builds significantly slower, but at least they succeed. I’m still trying to come up with a better solution, and the root cause is not entirely clear. It doesn’t seem to be an issue with Maven Central specifically. I did try setting up a Google Cloud Artifact Registry as a proxy for Maven Central, and hit the same error message only on Xcode Cloud.
t
Great, thanks for sharing. But I have been using github actions with Tartelet for some time now which is working so great I will stay with that.
c
I came up with a better workaround—I wrote my own proxy in Java that all my Gradle network connections are routed through. The proxy can then throttle the network connections without requiring Gradle to become single-threaded. Doing this has been robust without the performance hit of the previous workaround.
137 Views