I cannot get Visual Studio 2022 to recognise the downloaded JDK8 required by Xamarin project?

stuart wines 20 Reputation points
2023-04-04T16:37:54.2366667+00:00

I am attempting to create an Xamarin Android project using C#, but this fails as the activity_main.xml insists it needs JDK8 to display the target screen. I've downloaded and installed JDK8, but inserting its address under Xamarin JDK Location in tools does not solve the problem. In addition, any Xamarin project saved cannot be reopened as it fails with a message that it cannot find an editor for activity_main.xml.
Any help would be appreciated.

Developer technologies | Visual Studio | Other
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,446 Reputation points Microsoft External Staff
    2023-04-05T08:29:06.61+00:00

    Hello @stuart wines ,

    Welcome to Microsoft Q&A forum.

    Typically, if you install the necessary workloads and components in Visual Studio, Visual Studio will set configurations automatically.

    Please open Visual Studio => click Tools => Options => Xamarin => Android Settings => Java Development Kit Location, verify that the location of the jdk is set correctly(recommend using jdk 11 or higher). User's image

    Please also try to reset VS settings by running devenv /ResetSettings command in Developer Command Prompt for Visual Studio 2022.

    If above methods don’t work, please share us the detailed steps that you have done to install Xamarin support in VS for checking.

    Feel free to contact us.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.