When trying to build our Xamarin.Forms project on a newly setup Windows 10 build slave using Jenkins, we get the following error while building the Android project:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2669,3): error : Sequence contains no matching element [C:\Jenkins\ws\TELE-2343-muc-s\src\RequesterClient.Droid\RequesterClient.Droid.csproj] powershell.exe : An error occurred when executing task 'Build'. At C:\Jenkins\ws\[email protected]\durable-9ea97135\powershellWrapper.ps1:5 char:3 + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Fi ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (An error occurr...g task 'Build'.:String) , RemoteException + FullyQualifiedErrorId : NativeCommandError Error: One or more errors occurred. MSBuild: Process returned an error (exit code 1).
The Jenkins slave is using the latest Visual Studio 15.8, has all the latest Android SDKs, NDK, build tools (updated from the SDK manager), etc. The project itself is using Xamarin Forms 2.5 and Xamarin Android 27 libraries (targeting 27) and is built via Cake Script using MSBuild commands.
When building this on the machine itself (from Visual Studio or via the Cake Script, on an Admin account) everything works fine, but when running this from Jenkins with the same build command, we get this error. Jenkins is running from another user, but even if this user has admin rights it doesn't change. Did anyone encounter this issue before or has any suggestions? Is there some permission we're missing?