Do not set /m parameter for MSBuild by default
See original GitHub issueWhat You Are Seeing?
Xamarin based projects are not compiling correctly. Either SDK files are not found or Android packages are not downloading correctly on a clean build server with minimal build tools installed.
Note: This works perfectly if I execute msbuild manually on exact same system
and
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5207: Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5207: Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Java library file C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\libs/internal_impl-23.3.0.jar doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5206: Please install package: 'Xamarin.Android.Support.v4' available in SDK installer. Android resource directory C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\./ doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5207: Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Java library file C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\embedded\classes.jar doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5206: Please install package: 'Xamarin.Android.Support.v7.CardView' available in SDK installer. Android resource directory C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v7.CardView\23.3.0.0\embedded\./ doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5207: Please install package: 'Xamarin.Android.Support.v7.RecyclerView' available in SDK installer. Java library file C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\embedded\classes.jar doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(387,2): error XA5206: Please install package: 'Xamarin.Android.Support.v7.RecyclerView' available in SDK installer. Android resource directory C:\Users\build\AppData\Local\Xamarin\Xamarin.Android.Support.v7.RecyclerView\23.3.0.0\embedded\./ doesn't exist. [E:\Builds\GitHub\Xamarin-Forms-Labs\src\Forms\XLabs.Forms.Droid\XLabs.Forms.Droid.csproj]
I have also replicated this on both a Windows 10 (Build 1511 base) and a Windows 2016 Tap 5 build server.
It seems that there is something that cake is doing when it executes msbuild that is resulting in the error.
What is Expected?
Build should work as expected. if I run msbuild manually it works 100% of the time on a clean system
What version of Cake are you using?
Tried
- Version 0.13.0+Branch.main.Sha.f7346f2a5fb4e19a24cf15780ce635529f921be4
-
Are you running on a 32 or 64 bit system?
64
What environment are you running on? Windows? Linux? Mac?
- Windows 2012R2
- Windows 10 (based on 1511)
- Windows 2015 Tap 5
Are you running on a CI Server? If so, which one?
- Standalone and appveyor (both have same issue)
https://ci.appveyor.com/project/xlabs/xamarin-forms-labs-hva8p/build/2.3.0.3.master
How Did You Get This To Happen? (Steps to Reproduce)
Test 1 Windows 2012 R2
- Setup
- Windows Updates as of 7/21/2016
- Install Chocolatey
- Install 7zip
- Install Visual Studio 2015 Enterprise w/Update 3 (full install all components except emulators and lightspeed)
- Build Process
- Clone repository
- Execute .\build.ps1 -Target Package
- Result Fails
- Immediately execute .\build.ps1 -Target Package (which does a full clean)
- Result Succeeds
Test 2 Windows 2012 R2
- Setup
- Windows Updates as of 7/21/2016
- Install Chocolatey
- Install 7zip
- Install Visual Studio 2015 Enterprise w/Update 3 (full install all components except emulators and lightspeed)
- Install Xamarin Tools (from Xamarin.com) with defaults (see screenshots below)
- Build Process
- Clone repository
- Execute .\build.ps1 -Target Package
- Result Fails
!(AndroidSDKInstall)[https://i.imgur.com/T76dTVv.png] !(MissingComponents)[https://i.imgur.com/fkWOYAx.png]
Test 3 Windows 2012 R2
- Setup
- Windows Updates as of 7/21/2016
- Install Chocolatey
- Install 7zip
- Install Visual Studio 2015 Enterprise w/Update 3 (full install all components except emulators and lightspeed)
- Install Xamarin Tools (from Xamarin.com) with defaults (see screenshots below)
- Build Process
- Clone repository
- Execute …nuget\nuget restore .\src\XLabs.sln -ConfigFile …nuget\nuget.config
- Execute msbuild /m /v:normal /p:Configuration=“Release” /p:Platform=“Any CPU” /p:TreatWarningsAsErrors=False /target:Build "E:/Builds/GitHub/Xamarin-Forms-Labs/src/XLabs.sln
- Result Fails
Test 4 Windows 2012 R2
- Setup
- Windows Updates as of 7/21/2016
- Install Chocolatey
- Install 7zip
- Install Visual Studio 2015 Enterprise w/Update 3 (full install all components except emulators and lightspeed)
- Install Xamarin Tools (from Xamarin.com) with defaults (see screenshots below)
- Build Process
- Clone repository
- Execute …nuget\nuget restore .\src\XLabs.sln -ConfigFile …nuget\nuget.config
- Execute msbuild /v:normal /p:Configuration=“Release” /p:Platform=“Any CPU” /p:TreatWarningsAsErrors=False /target:Build "E:/Builds/GitHub/Xamarin-Forms-Labs/src/XLabs.sln
- Result Sucess
The issue seems to be related to the /m property
Output Log
Issue Analytics
- State:
- Created 7 years ago
- Comments:21 (14 by maintainers)
Top GitHub Comments
@gep13 not sure yet – still testing. That will be one of the tests I run and I’ll let you know what the result it.
Using the following
Seems to work – everything compiles now.
I have also submitted an issue on the msbuild git repository