I'm building a Xamarin Forms
app on vsts (via yml).
Steps are almost identicals for iOS and Android.
The whole solution builds fine on my machine and the iOS phase builds fine on VSTS.
However I get an error on the msbuild of the solution within the Android phase. The error is:
[error]C:\Program Files\dotnet\sdk\2.1.104\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(327,5): Error : Assets file 'D:\a\1\s\MyApp.Controls\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
I understand that I first have to run dot net restore
to generate the project.assets.json
file and I do. Here are my corresponding yml tasks:
- task: NuGetToolInstaller@0
displayName: 'Dot Net Restore'
condition: succeeded()
inputs:
command: restore
projects: |
MyApp.*/*.csproj
Platforms/MyApp.Android/*.csproj
Platforms/MyApp.Controls.Android/*.csproj
- task: XamarinAndroid@1
displayName: 'Building Android'
inputs:
solutionFile: '**/*.sln'
configuration: 'Release'
buildToolOption: msbuild
Note that MyApp.Controls.Android
has a reference to MyApp.Controls
(which is a .Net Standard library) and this is that project on which the error occurs.