I am trying to build a Xamarin project with Refit 6.0 via the command line.
I tried to compile the .Net Standard project with dotnet build and the Xamarin.Android project with msbuild.
dotnet build demo/demo.csproj
msbuild /t:Build demo.Android/demo.Android.csproj
I get the following error message in the xamarin android build.
/Users/ci/.nuget/packages/refit/6.0.24/buildTransitive/netstandard2.0/refit.targets(19,5):
error : Projects using Refit cannot build using MSBuild '16.6.0'. MSBuild '16.8.0' or later is required. [/Users/ci/work/tmp/demo/demo.Android/demo.Android.csproj]
Done Building Project "/Users/ci/source/demo/demo.Android/demo.Android.csproj" (Build target(s)) -- FAILED.
Build FAILED.
"/Users/ci/source/demo/demo.Android/demo.Android.csproj" (Build target) (1) ->
(_RefitMSBuildVersionCheck target) ->
/Users/ci/.nuget/packages/refit/6.0.24/buildTransitive/netstandard2.0/refit.targets(19,5): error : Projects using Refit cannot build using MSBuild '16.6.0'. MSBuild '16.8.0' or later is required. [/Users/ci/source/demo/demo.Android/demo.Android.csproj]
0 Warning(s)
1 Error(s)
Docs excerpt:
"SDK Requirements Refit 6 requires at Visual Studio 16.8 or higher, or the .NET SDK 5.0.100 or higher. It can target any .NET Standard 2.0 platform." source: https://github.com/reactiveui/refit#sdk-requirements
What is the correct command line command to build an APK and IPA?
Update 1:
I have found a workaround for the problem. https://github.com/microsoft/appcenter/issues/2120#issuecomment-798798890
I image it would just require an environment variable / symbolic link change for msbuild. For example, point msbuild
to mono /Applications/Visual\ studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/MSBuild.dll
instead of using the current default msbuild.