Xamarin - Unable to build project (XA0031 - Java SDK 11 or above is required...)
Hello! I'm trying to build an Android project that I created in Visual Studio 2022, but I'm getting a rather contradicting error regarding my JDK installation. It says that it needs JDK 11.0 for the selected framework version, but on the next line it says that the designer is incompatible with this version. I have tried installing the latest JDK (version 17.0.1), but I still get the same error. Maybe Rider is not using the newly installed JDK as default for Android builds?
How can I solve this issue?

(The reason why I created the project in VS2022 instead of Rider is because VS offered a pre-made template with a drawer menu layout, whereas Rider did not)
Please sign in to leave a comment.
Hello Lazar Zsolt 725,
Please check the JDK Location in Rider settings: `File | Settings | Build, Execution, Deployment | Android`, and make sure it points to the newly installed JDK.
Does it help?
Hi Julia Vaseva,
Thank you very much, it worked like a charm. Seems obvious too, I don't know how I didn't think to look there.
For a moment I thought I was gonna have to use Visual Studio! 🙂
Lazar Zsolt 725 I'm happy to hear you got it sorted :) In Rider 2021.3 we've added a problems view to help detect such problems more easily.
In my case, I had to specifically install the OpenJDK 11 so that it works with Xamarin.Android v12
Julia Vaseva your suggestion unforunately not working although we have all set up correctly as shown below but Rider still not able to built correctly. All Sdk version are installed as well. Can you please tell us what is wrong with Rider? If we install VS or VS Mac on the same PC or Mac, it works fine. But Rider alone on a machine is not working and finding JDK or SDK directly.
Rider+Android Studio is also not working. Only Installing VS solves the problem
Hello Emil,
Could you please let me know the following details:
Thank you in advance! Looking forward to hearing from you soon.