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)

4 comments
Comment actions Permalink

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?

2
Comment actions Permalink

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! 🙂

 
0
Comment actions Permalink

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.

0
Comment actions Permalink

In my case, I had to specifically install the OpenJDK 11 so that it works with Xamarin.Android v12

1

Please sign in to leave a comment.