I'm trying to create a build definition to build and package an Android app based on Xamarin Forms.
I've installed Visual Studio 2017 and Xamarin on my build server, and even after restarting my server, my agent does not find the Xamarin.Android capability.
I'm still getting an error while queuing one build :
No agent could be found with the following capabilities AndroidSDK, MSBuild,
Xamarin.Android, JDK
The only capability that is missing on my agent are Xamarin.Android, MSBuild , AndroidSDK
I add the environnement variable "Xamarin.Android" , i restart the build agent ; but the same error
Do you have any idea on how to add it on my agent ?
Related
I am trying to build a Xamarin app in Azure Pipelines. Xamarin Android project is building well locally in Windows / MAC . But Xamarin Android build is failing on Azure Pipelines. I am getting the below error while trying to build the Xamarin.Android app in Azure Pipelines.
#[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Aapt2.targets(87,3): Error APT2000: top-left corner pixel must be either opaque white or transparent.
##[error]Resources\drawable-hdpi-v4\abc_ab_share_pack_mtrl_alpha.9.png(0,0): Error APT2261: file failed to compile.
I don't have this folder in source code. This folder ( drawable-hdpi-v4) is automatically getting generated. I don't know how this folder / image is getting created automatically.
Configurations are given below
MS Build Latest Version
Build Agent : Windows
Xamarin Android : 10.3.1.4
Visual Studio : 16.6.
The issue got fixed after updating Visual Studio 2019 to latest version ( 16.7.3) and Azure Pipeline Agent ( 2.174.2).
I have a solution with,
Xamarin.iOS project
NetStandard 2.0 project
The tools I use are,
Visual Studio for Windows 2019 (v 16.3.2)
Xamarin.iOS SDK (13.2.0.42)
I can successfully build the application. But it gives this error on launching for both the Device and the Simulator,
error MT1001: Could not find an application at the specified directory: /Users/myUser/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS//bin/iPhoneSimulator/Debug/MyApp.app
When I checked the Xamarin.logs for more info, I see this,
Xamarin.Messaging.Ssh.SshCommandRunner|Warning|0|Failed to execute 'which mono64': ExitStatus = 1
How can I fix this?
You have to specify the Platform Target in a way to allow a x64 build.
Right click on the Xamarin.iOS project and selection Properties. In the Properties Window, under Build tab, select either Any CPU or x64 for the appropriate Configuration and Platform.
That's all 😊 Try to redeploy.
I'm working on Xamarin Forms application in Visual studio 2017 .I wanted to deploy application to android simulator .I try to deploy it debug mode.
i set android project as the startup project
When i deploying i get this warning
No Address and User has been specified in order to establish a connection to a Mac Server, so only the main assembly was compiled for project CMI.IOSApp. Connect to a Mac Server and try again to build the full application.
Go to VS menu Build->Configuration Manager is iOS project tick when you have set your android project as start up project.
So the Build and Deploy checkbox for iOS project should be untick when you are going for Android build.
Visual Studio is the recommended tool (superseding Xamarin Studio) on both Windows and Mac. However, the VSTS page Build your Xamarin app says to use "Xamarin". Presumably that means Xamarin Studio, even though the the "Install Xamarin" link on the page points to Visual Studio. That ambiguity and the March 6 date on the page indicate that it was overlooked during the rollout of Visual Studio 7 for Mac, leaving us to wonder what is the right approach for setting up an agent.
What is the best way to create an iOS build agent these days? Do you install Visual Studio for Mac or Xamarin Studio?
Sounds like a bit of confusion here in the terminology. The IDE is now Visual Studio for Mac, but the underlying framework is still Xamarin. That is to say, Xamarin.iOS/Xamarin.Android/Xamarin Forms are "integrated" into Visual Studio for Mac; they are the tools that will compile and package your mobile app. This is what the VSTS build task page is saying when it asks you to "Install Xamarin".
As for setting up a VSTS build agent, here's a checklist that will hopefully get you going:
Download and install Visual Studio for Mac on a computer running OS X/macOS. Confirm that Visual Studio for Mac can indeed build and sign the IPA's.
If necessary, install all the certificates and provisioning profiles, and confirm that the IPA is correctly signed.
Create a build project in VSTS.
Install the VSTS build agent for OS X/macOS and connect/register the build agent to the VSTS project. Please be aware that the Xamarin license task/utility is deprecated and no longer needed. If that does appear as a step in your VSTS build project, delete it.
Go back to VSTS, and configure the VSTS project to build the Xamarin.iOS project via the OSX/macOS build agent. Once the build agent is connected to the VSTS project.
I'll admit, there is a lot of moving parts and things to do here. I hope this high level overview is enough to point you in the right direction.
Per starain's advice, I tried installing VS for Mac. It started up, but failed with an 'Unable to parse condition "!(Exists($(SharedVersionOutputDirectory)))"' error. I've encountered several bugs in the Xamarin tool chain, so this may have nothing to do with VS vs. XS, but just be part of the current duct-tape-and-bailing-twine experience. OTOH, there's still a top-level Xamarin page saying VS Mac is still preview, so who knows how baked it really is?
So even though the Mac build agent does find and run the VS Mac build tooling, I gave up and used my Windows build agent instead, and had MSBuild on Windows connect to the Mac for the iOS build.
I am the newbie in Xamarin Cross Platform development. I am using Visual Studio 2015 Preview for development. I created the new solution for mobile app and it is working correct for both Droid and Windows phone. But after successful connection with iOs Build host I got the error when I build the iOs App like -
Xamarin.iOS does not support running or debugging the previous build version of your project.Please ensure your solution builds before running or debugging it.
And also when I click on View iOS Simulator I got build host error.
Error: Build version problem. it will show the build version problem.
Please tell me the solution for this.
Most common cause of those symptoms
The most likely cause of this issue is the following known bug:
https://bugzilla.xamarin.com/show_bug.cgi?id=25811
Explanation
The problem in that bug is that the Xamarin.Forms template is using a bad default setting for the iOS project in Visual Studio's configuration manager.
The configuration manager works by telling Visual Studio which projects you want to be built and/or deployed at the same time in the configuration you're using at the time.
So for example; when you build your Android project in Forms, the configuration manager makes sure that the shared project is included; otherwise it wouldn't work, or you'd have to build it separately or etc. etc. (i.e. a real pain.)
Normally, Visual Studio doesn't have a way to automatically "know" which project(s) you want to include in all your configurations; you'd have to tell it to include (some library) with (some app); etc. manually.
How to fix it
Screencast: http://www.screencast.com/t/zLoQOpEn
Go to "Build -> Configuration Manager"
Select the configuration(s) you wish to adjust, (e.g. Debug | iPhoneSimulator, Release | iPhone)
Make sure your shared library project(s) are included with the platform-specific configurations. (You can ignore the greyed-out 'Deploy' checkboxes, those are handled automatically)
Why this is a bug
So this isn't a bug in that the configuration manager isn't working correctly for iOS projects, but that the Forms template is using a bad default setting for the iOS projects when you create a new app. It should "know" to include the shared project in the iOS configurations by default.