How can I specify Xamarin version in Appveyor build process? - xamarin

We use Appveyor for our continuous integration and it automatically includes the latest Xamarin version when creating the build vm.
However, all developers and the mac host for building the iOS app are using the previous version. We are unwilling to upgrade at this point as multiple projects are due to be released within the next few weeks and these big upgrades invariably add days of delay.
As such, it would be great if someone could show me how I can specify the Xamarin version when creating the build Vm. Thanks!

I sent an email to appveyor support and they replied with this partial solution:
I’m afraid we can’t have multiple versions of Xamarin as it ties pretty hard into Visual Studio environment. Maybe in the future they will do it more portable.
You can rollback to the previous build worker image for now. Add image: Previous Visual Studio 2015 to your appveyor.yml or select it on UI (Environment tab of project settings) if you don’t use yml. Of course, it’s not a long term solution as current image will become previous during the next update. It maybe Xamarin issue or the app should be upgraded to Xamarin Latest version.

Related

Xamarin Forms on TeamCity: Xamarin.Forms tasks do not match targets

I am building a Xamarin Forms solution (containing an iOS library, an Android library and a .NET Standard library) in TeamCity.
I have just upgraded to Xamarin Forms 3.1.0.583944. The project builds without any problem locally, but on my TeamCity build server (Windows Server 2016), I'm consistently getting the following error:
C:\BuildAgent\work\f12265fda07473c1\src\packages\Xamarin.Forms.3.1.0.583944\build\netstandard2.0\Xamarin.Forms.targets(44,
3): error XF002: Xamarin.Forms tasks do not match targets. Please
ensure that all projects reference the same version of Xamarin.Forms,
and if the error persists, please restart the IDE.
I have tried downgrading Xamarin Forms, and rebooting the build agent. Neither of these has succeeded.
UPDATE: There is a new error:
C:\BuildAgent\temp\buildTmp.nuget\packages\xamarin.forms\3.0.0.561731\build\netstandard2.0\Xamarin.Forms.targets(44, 3): error XF002: Xamarin.Forms tasks do not match targets. Please ensure that all projects reference the same version of Xamarin.Forms, and if the error persists, please restart the IDE.
For some reason, the agent is looking for Version 3.0.0.561731. But that is no longer anywhere in the project. I had deleted the entire C:\BuildAgent\temp\buildTmp\.nuget\packages\xamarin.forms\3.0.0.561731 folder, but it has come back.
ADDENDUM: I notice that every time I upgrade Xamarin.Forms to this version via NuGet, it fails to uninstall the old package, and I have to restart Visual Studio to complete the process. This happens without fail. I am fairly sure this is connected to the breaking build, but that is more due to speculation and experience than concrete analysis.
I found out how to fix the problem, but it's not clear to me why it would manifest in the way it has -- locally and even when I RDP onto the build agent, it builds without trouble, but when I run the build agent from the TeamCity console I hit these compilation errors.
One of my dependencies is a NuGet package, which itself has a dependency on Xamarin Forms. Fortunately, I own that NuGet package, and was able to upgrade its Xamarin Forms version to the latest available package. If I didn't own that package I would be completely stuck though -- so this is only a partial solution.
The above answer was quite helpful for me . I would like to add a couple of additional notes though. I was facing this issue when I was using Xamarin Forms 3+ and my local build was being really inconsistent with the same error "Xamarin.Forms tasks do not match targets. Please ensure that all projects reference the same version of Xamarin.Forms, and if the error persists, please restart the IDE.". Then I cleared my local NuGet cache and rebuilt the project and saw that there were other NuGet package versions being pulled for Xamarin Forms when I did a NuGet restore. I then reversed the ordering of the NuGet packages starting with Xamarin Forms and it all worked fine.

Need lower version of visual studio for mac

I just want to download a lower version of Visual Studio for Mac. The current version is 7.5.1 and I want to download 7.4.3.
Can anyone tell me where can I get that download file or link?
From some guesswork I found it by using this URL :
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.4.2.12.dmg
Not installed it tho.
From this, comment on the 9th May link seems like you have to open a support ticket?!?!
As an update on this topic, all of the recent previous Xamarin.iOS,
Xamarin.Android, and Xamarin.Mac packages are available in the
archives on the open source continuous builds server (under the
Xamarin.Android and Xamarin.MaciOS tabs). And the Mono Framework MDK
is similarly available in the Mono Project download archive. I have
now updated the 15.7 Release Xamarin Release Blog post to provide the
links to those locations. In many cases, the latest version of Visual
Studio for Mac will be backwards compatible with previous versions of
the Xamarin SDKs, so you can in many cases just install those earlier
Xamarin SDK versions over the current versions and leave Visual Studio
for Mac and Mono Framework MDK at the latest.
If you do need to get an older version of Visual Studio for Mac
itself, the best option at this time is still to create a support
incident to request the version you'd like. The updated info for
creating a Visual Studio for Mac support incident is to go to
Technical Support > Product: Visual Studio > Assisted Support on
https://www.visualstudio.com/vs/support/ and then select Visual Studio
Community/Professional/Enterprise 2017 for Mac.
I used to download previous releases from my Xamarin account page
which now doesn't seem to exist anymore.
At the moment, the direct link to the old downloads page
(https://store.xamarin.com/account/my/subscription/downloads) is not
yet set to redirect, so it is still possible to access that page, but
indeed that page is considered deprecated in favor of the open source
continuous builds archive at this time, and the previous versions
provided on that page are from the earlier Xamarin 15.5 Release rather
than the Xamarin 15.6 Release.
Bunch of other versions in case someone needs them:
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.3.0.797.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.3.0.799.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.3.3.5.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.3.2.12.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.4.0.1033.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.4.0.839.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.3.3.5.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.4.0.884.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.4.0.985.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.4.0.1026.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.5.0.933.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.5.0.1062.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.4.1.48.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.5.0.1161.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.5.0.1244.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.5.0.1222.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-Preview-7.6.0.711.dmg
https://dl.xamarin.com/VsMac/VisualStudioForMac-7.8.4.1.dmg
Note: These are from the index.xml files that VS4M downloads that includes all the matching packages for each release
You could also look for versions listed at the brew repository.
Use the url pattern https://dl.xamarin.com/VsMac/VisualStudioForMac-{version}.dmg.

Xamarin Visual Studio 15.6.2 creating a mobile app missing UI technology option

I Recently upgraded to the latest Visual Studio first 15.6.1 and then 15.6.2 from 15.4.2 as 15.4.2 was failing to build a release build for me of the app and builds in general were very unstable. I am working on as a proof of concept app.
An upgrade to the latest versions did not help, so I decided to create a smaller app that hopefully built and slowly add functionality to attempt to discover when the process fails. Creating a cross=platform, mobile app, now failed to show the option for UI technology and is then missing all the required references for Xamarin.Forms. I do not see, anywhere that this is a new Feature, so I assume this is a bug.

Multiple errors after updating Xamarin Forms

I'm using Visual Studio 2017, and I stared a new Xamarin Forms app:
Create New project - Cross Platform App (Xamarin)
Blank App, and I chose Portable Class Library (PCL)
The app compiles and runs.
Now I right click the solution and choose Manage Nuget packages for solution, and it tells me I'm running version 23.3.0 and I should update to 25.4.0.1
After the update and 3 VS reboots, it gives me a host of errors I have been trying to solve for an hour including googling.
All theme related.
I tried removing the styles.xml file all together. I removed the theme from the reference to the theme from the manafest and it keeps putting it back.
I can't figure out what I'm doing wrong. I have not written any code.
Xamarin Forms requires a specific version of the Android Support libraries. Do not update them.
Delete your project and create a new one.
It is possible to get round this limitation by ensuring you are using a specific version of Android and by updating all Android SDK's, but for a beginner I would recommend just using the support libraries that are installed alongside Xamarin Forms.

error : Error initializing task XamlG: Not registered task XamlG

I am developing a Xamarin Forms (PCL) application for IOS and Android Platform.
My Xamarin Studio version is 5.5.4 (Build 15). I am on stable channel.
My Xamarin Forms dll version is 1.3.0.6292.
I have also added a Xamarin Forms Labs reference from NuGet, v1.2.0.
Since yesterday, whenever i am building the solution, i get following error:
error : Error initializing task XamlG: Not registered task XamlG.
Any possible resolution for this error? I have tried clean and build multiple time. Even deleted the entire source code and redownloaded everything from source control but same error.
This error can occur if you have upgraded from an older version of Xamarin.Forms to a newer version. The underlying problem is that the wrong Xamarin.Forms.Build.Tasks.dll is being loaded compared with the one that the custo MSBuild Xamarin.Forms.targets file is expecting.
There is a bug in Xamarin Studio where the old build Xamarin.Forms build tasks are still used after the NuGet package has been upgraded. You can workaround this by closing and re-opening the solution.
However you say you have deleted the source code and downloaded everything again so it sounds like you have a different problem. It may be that your project is trying to use two different versions of Xamarin.Forms at the same time. I would look at your project files (.csproj) in a text editor and make sure they are all using one version of Xamarin.Forms. Check that they are all referencing a single version of Xamarin.Forms.targets and it is the same version.
This is silly.
I just recloned the project in a new fresh folder and build it from scratch and it worked. The more i am using Xamarin Forms, the more buggy and unbaked it seems. There are random issues which get fixed just by rebuilding the project. Or like Matt pointed in his answer below, by just restarting the studio. In my programming experience with different IDEs and platforms, only Xamarin seems to have these problems regularly.

Resources