knocte
knocte

Reputation: 17969

Xamarin.Android support with GithubActions workflows? (or how to install JDK programmatically)

I'm trying to build a Xamarin.Android library with a WindowsVM spawned by a GithubActions workflow (marked as windows-latest), and I'm getting this error:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(798,2): error XA5300: The Java SDK Directory could not be found. Please set via /p:JavaSdkDirectory.

How to install the VisualStudio Xamarin tooling into this VM programmatically before I call the build script? I'm afraid that just installing the Java SDK (as instructed by the error) might not really cut it.

(I'm migrating from AzureDevOps to GithubActions; and this worked out of the box with the former, without the need to specify anything on the buildagent configuration.)

Upvotes: 1

Views: 592

Answers (1)

jonathanpeppers
jonathanpeppers

Reputation: 26505

Xamarin.Android 10.x from Visual Studio 2019 16.3 has a fix for this issue, unfortunately you'll need to download and install it during your build--it just came out!

I have been able to build Xamarin.Android projects on Github Actions when using boots, as in this example: https://github.com/jonathanpeppers/boots#github-actions

Upvotes: 2

Related Questions