I’m having trouble with Gradle builds inside Xcode...
# community-support
c
I’m having trouble with Gradle builds inside Xcode Cloud, with errors that look like this (the exact resolve that fails changes between runs)
Copy code
> Could not resolve org.jetbrains.kotlin:kotlin-serialization-compiler-plugin-embeddable:2.3.21.
            > Could not get resource '<https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/2.3.21/kotlin-serialization-compiler-plugin-embeddable-2.3.21.pom>'.
               > Could not GET '<https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-serialization-compiler-plugin-embeddable/2.3.21/kotlin-serialization-compiler-plugin-embeddable-2.3.21.pom>'.
                  > Got socket exception during request. It might be caused by SSL misconfiguration
The only workaround that I’ve been able to find is adding these gradle properties (which make the build very slow)
Copy code
systemProp.java.net.preferIPv4Stack=true
systemProp.java.net.preferIPv6Addresses=false
org.gradle.parallel=false
org.gradle.workers.max=1
I’ve tried: • Setting up a Maven Central proxy in Google Cloud with Google Artifact Registry. Same error occurs (with a different URL) when using the proxy. My original theory was Maven Central rate limiting Xcode Cloud IPs, but I don’t think that’s it. • Changing Java versions (17, 21, 25). Makes no difference. • Checking out open source projects and just compiling them. Now in Android ./gradlew assemble succeeds. Ktor ./gradlew assemble fails. Ktor is a much larger project, which hints that number of requests is related to triggering the issue. In any case, this eliminates something specific to my project. Does anyone have ideas on how to troubleshoot this further?
p
I don't know if it will work but you might need to use the system Keystore systemProp.javax.net.ssl.trustStoreType=KeychainStore And why did you disable parallel and set the workers to 1? This is unrelated to the SSL error and really slow down your build.
c
Disabling parallel and workers=1 is required to work around the issue.
Along with IPv4. Its bizarre—I can’t explain why that combination works.
I originally tried it under the theory that rate limiting was the issue
I will try that property and see if that works. I’ll report back in a few
v
parallel=false should probably be redundant if you have max workers 1. Anyway, what is the full stack trace?
c
Do you want the FULL stack trace or the relevant stacktrace? I think “relevant” is probably more helpful here.
Copy code
2026-05-13T11:57:44.772894431Z	Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD '<https://repo.maven.apache.org/maven2/io/ktor/ktor-server-default-headers/3.4.3/ktor-server-default-headers-3.4.3.pom>'.
2026-05-13T11:57:44.773150385Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.createHttpRequestException(ApacheCommonsHttpClient.java:190)
2026-05-13T11:57:44.773345213Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.performRequest(ApacheCommonsHttpClient.java:179)
2026-05-13T11:57:44.773526629Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.performHead(ApacheCommonsHttpClient.java:114)
2026-05-13T11:57:44.773699806Z		at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getMetaData(HttpResourceAccessor.java:58)
2026-05-13T11:57:44.773862382Z		at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.getMetaData(DefaultExternalResourceConnector.java:66)
2026-05-13T11:57:44.774027696Z		at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor$MetadataOperation.call(ProgressLoggingExternalResourceAccessor.java:173)
2026-05-13T11:57:44.806703188Z		at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor$MetadataOperation.call(ProgressLoggingExternalResourceAccessor.java:161)
2026-05-13T11:57:44.806880447Z		at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:210)
2026-05-13T11:57:44.807047279Z		at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:205)
2026-05-13T11:57:44.807209415Z		at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:67)
2026-05-13T11:57:44.807385303Z		at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:60)
2026-05-13T11:57:44.807576520Z		at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:167)
2026-05-13T11:57:44.807720624Z		at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:60)
2026-05-13T11:57:44.807991646Z		at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:54)
2026-05-13T11:57:44.808200844Z		at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.getMetaData(ProgressLoggingExternalResourceAccessor.java:55)
2026-05-13T11:57:44.808375531Z		at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.getMetaData(AccessorBackedExternalResource.java:156)
2026-05-13T11:57:44.808645777Z		at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.lambda$getResource$1(DefaultCacheAwareExternalResourceAccessor.java:98)
2026-05-13T11:57:44.809198679Z		at org.gradle.cache.internal.ProducerGuard$AdaptiveProducerGuard.guardByKey(ProducerGuard.java:97)
2026-05-13T11:57:44.809421774Z		at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:80)
2026-05-13T11:57:44.812942549Z		at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadByCoords(DefaultExternalResourceArtifactResolver.java:149)
2026-05-13T11:57:44.813142382Z		... 54 more
2026-05-13T11:57:44.813406830Z	Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Got socket exception during request. It might be caused by SSL misconfiguration
2026-05-13T11:57:44.813685305Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.wrapWithExplanation(ApacheCommonsHttpClient.java:195)
2026-05-13T11:57:44.813863767Z		... 73 more
2026-05-13T11:57:44.814031622Z	Caused by: java.net.SocketException: Connection reset by peer
2026-05-13T11:57:44.814225066Z		at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:368)
2026-05-13T11:57:44.814435766Z		at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
2026-05-13T11:57:44.814746570Z		at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)
2026-05-13T11:57:44.814915408Z		at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
2026-05-13T11:57:44.815069857Z		at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
2026-05-13T11:57:44.824908491Z		at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
2026-05-13T11:57:44.825162573Z		at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
2026-05-13T11:57:44.825362497Z		at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
2026-05-13T11:57:44.825609524Z		at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
2026-05-13T11:57:44.825802316Z		at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
2026-05-13T11:57:44.826014160Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.performHttpRequest(ApacheCommonsHttpClient.java:257)
2026-05-13T11:57:44.826234048Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.performRawRequest(ApacheCommonsHttpClient.java:233)
2026-05-13T11:57:44.826465639Z		at org.gradle.internal.resource.transport.http.ApacheCommonsHttpClient.performRequest(ApacheCommonsHttpClient.java:175)
2026-05-13T11:57:44.826764481Z		... 72 more
v
Well, it says "Connection reset by peer", so the other side (or something in between like a proxy or firewall) is hanging up the phone during the call.