Hi, I cloned the `apollo-kotlin` project and I am...
# apollo-kotlin
s
Hi, I cloned the
apollo-kotlin
project and I am getting this error while trying a gradle sync:
Could not read '<https://api.adoptium.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/eclipse>' as it does not exist.
Any help to solve this would be appreciated. Thank you!
m
Mmm, that's unexpected. Maybe a Gradle toolchain issue somewhere? Do you have more context or just this error?
Double check that you're using the Gradle wrapper?
I'm using JDK17 fwiw and it's working well
s
this is the output for running
java --version
:
Copy code
openjdk 17.0.4.1 2022-08-12
OpenJDK Runtime Environment (build 17.0.4.1+0-17.0.4.1b469.62-9127311)
OpenJDK 64-Bit Server VM (build 17.0.4.1+0-17.0.4.1b469.62-9127311, mixed mode)
m
Interesting
Can you share more of your sync output? You should have something like
Copy code
> Unable to download toolchain matching these requirements: {languageVersion=18, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read '<https://api.adoptopenjdk.net/v3/binary/latest/18/ga/linux/x64/jdk/hotspot/normal/adoptopenjdk>' as it does not exist.
Can you try forcing the download from Azul?
Copy code
diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts
index 65f2b81f3..25d708b7f 100644
--- a/build-logic/build.gradle.kts
+++ b/build-logic/build.gradle.kts
@@ -56,6 +56,7 @@ dependencies {
 // 'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
 java {
   toolchain.languageVersion.set(JavaLanguageVersion.of(8))
+  toolchain.vendor.set(JvmVendorSpec.AZUL)
 }
 
 gradlePlugin {
Maybe adoptium didn't release JDK8 for M1
s
Possibly. I am trying to change the JDK version in AS to the one referenced in the exception log and see if that would work.
m
Is command line ok?
s
Nope. Same error on command line:
Copy code
* What went wrong:
A problem occurred configuring root project 'apollo-kotlin'.
> Could not determine the dependencies of null.
   > Could not resolve all dependencies for configuration ':classpath'.
      > Failed to calculate the value of task ':build-logic:compileJava' property 'javaCompiler'.
         > Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific}
            > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
               > Could not read '<https://api.adoptium.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/eclipse>' as it does not exist.
m
Can you try with Azul?
s
trying…
m
Looks like this is the problem. Adoptium didn't release M1 binaries for JDK8 🤔
s
Seems like it. Been to that page as well, and couldn’t find the ref’d jdk from the exception
m
I would expect Gradle to fallback to another vendor
Any luck with Azul?
Azul has them
s
Azul seems to have cleared that exception 😄. Thanks. But I have ran into another exception now. Will share the details if I am not able to resolve it.
Thanks a lot, @mbonnin
m
Nice! Want to submit a PR to change the vendor to Azul by default? Others might have the same issue
s
Will do. Thanks.
m
Thank YOU 🤗
s
Hey @mbonnin, I am not sure what I missed the first time, but command line seems to be working fine without forcing Azul. The problem might have been with opening the project in AS. Please let me know if the PR is still necessary and I will proceed to submit it.
m
Could it be because the toolchain is now installed and you don't have the issue anymore?
It might be a one time only thing
Please open the PR so we can track this at least if someone has the same issue
s
Sure
Pull request here.
243 Views