I'm trying to build the Android project of my Xamarin.Forms solution with msbuild:
set MSBuild="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" %msbuild% RoyalMobileApps.XF.Android.csproj /p:Configuration=Release /t:PackageForAndroid
The build succeeds, the .apk has all needed dlls in its assemblies subfolder, but the bin\Release folder itself is missing many dlls. I try to run an obfuscator during the build, so I need those dependencies.
This all worked before but something in the build process seems to have changed.
I digged through the logfile and found this message for (at least some of) the missing dlls:
This reference is not "CopyLocal" because at least one source item had "Private" set to "false" and no source items had "Private" set to "true".
When searching for that message I found https://github.com/NuGet/Home/issues/1084. But that issue is for Windows and the workaround from there did not work for Android.
Any idea how I can enforce the CopyLocal for all dependencies?