Quantcast
Channel: Chaminda's DevOps Journey with MSFT
Viewing all articles
Browse latest Browse all 339

Fixing Azure DevOps Xamarine Build error XA5300: The Java SDK Directory could not be found

$
0
0
When you try to build xamarine android projects with Azure Pipelines hosted agent Windows 2019 with VS2019 you might encounter error “XA5300: The Java SDK Directory could not be found”, if you are using a visual studio build task or msbuild task to build a solution which includes android projects. This is caused due to the inability to find the java sdk in the hosted agent. Let’s see how we can get this issue fixed.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(721,2): error XA5300: The Java SDK Directory could not be found. Please set via /p:JavaSdkDirectory. [d:\a\1\s\Host\xxxxxxxxxxxxxxxxxxxxxxxxxxx]

"d:\a\1\s\xxxxxxxxxx.sln" (default target) (1) ->
"d:\a\1\s\Host\xxxxxxxxxxxxx.Android.csproj" (default target) (14) ->
   C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(721,2): error XA5300: The Java SDK Directory could not be found. Please set via /p:JavaSdkDirectory.

To fix the issue pass /p:JavaSdkDirectory="$(JAVA_HOME_8_X64)" in msbuild arguments of the visual studio build task.
This will allow the msbuild to find the java sdk and will successfully build your android project.

Viewing all articles
Browse latest Browse all 339

Trending Articles