Building a Xamarin app using a Dev-Ops pipeline, build completes, publish fails, - xamarin

I have the following configured Azure DevOps pipeline which is building the Windows version of the Xamarin App, was going to try and get that one working first and the build works, but I'm getting an error in the publish, path not found, the 2 paths look fine but I guess this is down to me not building one of these before.
Build step which works fine
Publish artifact step which fails
The error that I get is as follows
Still trying to work out what I have got wrong, so I will keep going at it but if anyone
has any hints would be greatly apprecaited.

This thread as posted by Hongxin Sui was the solution for me, this is the thread.
Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\s\$(buildStagingDirectory)
However, what I did need to do was create a new YAML pipeline and I copied all the working steps in from the previous classic pipeline, I used the "Copy YAML" functionality and then I used the different Task as stated in that thread. Just make sure you change the case of the "Build" and "ArtifactStaging.." variable names as they need to be lower case not upper case.

Related

Nativescript sidekick error during cloud build

I am getting a strange error from sidekick cloud build since a few hours ago.
I was building the app successfully, but all of a sudden, it gives me the following error and even reversing the changes does not fix anything. I have even tried with a fully working version of my git repo.
[19-01-28 16:55:27.709] Build step started.
[19-01-28 16:55:37.465] (CLI) Unable to apply changes on device: a754d27bafb8bb273e444b9d6cefd370cd55f4d4. Error is: Build failed..
[19-01-28 16:55:37.469] Error detected during LiveSync on a754d27bafb8bb273e444b9d6cefd370cd55f4d4 for C:\Users\Afshar\Desktop\myapp. Error: Build failed.
I doesn't give me any more details about the issue.
I was wondering if anyone knows how to get more logs in cloud build or if this is a known issue?
Thanks
It happens with me as well for reasons unknown. I couldn't find any root cause, but I did notice one pattern. It usually happens when I am already running the app on an Android Emulator/Device.
When we execute tns run android --bundle, it listens for file changes after the first build and does some webpack incremental build thing afterwards, right?
At the same time, once Sidekick delivers a successful iOS build, it also starts listening for changes to do the webpack incremental builds on iOS.
So while we have these two LISTENERS active and we request for another iOS cloud build, before Sidekick communicates with the cloud, it modifies some files which the android listener detects and results in an incremental android build, which in turn modifies some other files, which the iOS listener detects, resulting in Sidekick trying to do the incremental iOS build but this time its stuck between giving you the incremental update and the new requested cloud build, so it throws you this LiveSync error.
Moral of the story: Try to request cloud builds, when these listeners are inactive.
I finally managed to solve it.
In case anyone else faces this issue, I tried the following command using a hint on this page and it solved the problem.
https://docs.nativescript.org/troubleshooting
tns platform remove ios
and then, I was able to build the project in sidekick.

Build passes even on failing test cases in Jenkins

Some of the steps that i have done are described below:
Setup Jenkins on remote linux server.
Used own mac as a slave to
run Xcode build
I have setup a Web hook on bitbucket that runs a
build on Jenkins server.
Build gets triggered when i push code to
repo.
I have shared scheme in the Xcode project.
But whenever i push failing tests on my repo the build passes..Shouldn't CI server fail the build..I dont know where am i missing..I have posted some screenshots for clear reference
EDIT: with more research i came to know that build fails but you need to see the test results/reports that fails.How can i see the reports? I cant see any xml files under reports section
Even I have faced the same issue where build was successful even though test cases were getting failed. You can use Log Parser plugin to parse the console output and mark your build as either stable or failed based on the output.
The jenkins runs in a step by step fashion.Build succeeds means your build step is correct and there's no issue with that but it does not mean your test cases have also passed.You need to check that with Junit if your test cases pass or not.
In your execute shell phase, you might need to add set -exo pipefail at the top.

TeamCity Dependency not sticking around

I'm sure this is a dumb mistake on my part but I can't find the right answer.
I have a project that has a snapshot dependency on another project. For sake of discussion website is dependent on toolkit.
Monitoring the build folder:
c:\programs\Teamcity\buildagent\work
I see the toolkit get built and the folders all exist as expected:
c:\programs\teamcity\buildagent\work\toolkit
Then the website build kicks off and the folder above gets deleted before the website build starts.
This results in the website saying the reference couldn't be found. What setting am I missing?
Using TeamCity 7.1.2, working on getting it upgraded to 8.1 but it requires some internal evaluation first.
Don't think its a version issue. How do both of your builds know where to put the artefacts at . For ex teamcity normally builds stuff at c:\programs\teamcity\buildagent\work****\toolkit , not at c:\programs\teamcity\buildagent\work\toolkit ?
Also, if your targets are dependent upon each other across builds, (1) have you setup any artefact dependencies or (2) any process that does not read of a shared agent workspace ? or (3) forcing both builds to run from the same directory
See if both your builds are running on the same target "folder name". In case they are , deselect any option that "cleans up build targets" before they run.
Also, you might want to check your build files to see if they have any code to clean directories before they start to run

Jenkins Xcode build arguments to change the application name

I've got a phonegap project that is getting built via Jenkins via the Xcode plugin. After the project is built, I'm using the TestFlight plugin to upload it there. Everything works great.
Now, I need to add two more versions of this for our different environments so I'll have a Dev and Test version (and also Prod, but not to TestFlight).
In order to do this, I need to change the name of the application so both Dev and Test show up in TestFlight, MyProgram-Dev, and MyProgram-Test. Then the production version would just be MyProgram.
In the xcode section on Jenkins, there's a "custom xcodebuild arguments" field that can be filled out, which I'm assuming is where I need to make my changes. I want to do this at build time because I don't want the program name to change when merging Dev into Test, etc.
I've done alot of googling and can't find any example command line parameters for the xcode build process. Is it the CFBundle that I need to be changing? What is the name of the parameter to change?
Edit: So I was able to change the production name via 'PRODUCT_NAME=MyProject-Test', but that produced the following error:
The following build commands failed:
Ld /Users/buildaccount/Library/Developer/Xcode/DerivedData/MyProject-cpvmaiwadviebmbhkdggxpzejddf/Build/Intermediates/MyProject.build/Release-iphoneos/MyProject.build/Objects-normal/armv7/MyProject-Test normal armv7
Wow, that took alot of googling and testing.
Here's what was the eventual fix for my scenario. It was a combination of this post/answer, as well as this one.

TeamCity REST API to get list currently broken projects

Using TeamCity 8.0.4 (build 27616)
I use a call to my TeamCity server to get a list of broken builds:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:failure,sinceBuild:(status:success)
If I a project is in the failure state, that API call returns count =1 and the details of the broken project.
The problem is if that project has a currently running build, the API call returns count 0 and no projects in the broken list.
As soon as the project build finished (and breaks again) the count goes back to 1.
So hopefully there is something in my locator query that I can change to get broken builds even if they are currently building.
The TC ui seems to know about it because the parent projects of my broken project all show red. Just not sure how to get it right in the API query.
Try adding running:any. Maybe running defaults to false, although I can't find that in the documentation.
Here's how to display a list of failed builds:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:failure
Failed builds are builds that have already finished and failed, what I think you are looking for is a way of showing builds that are running and failing:
http://teamcity.exactbid.net/guestAuth/app/rest/builds/?locator=status:error,status:running
This looks for builds that are running and contain errors (which cause the build to fail, unless explicitly told not to)
You may have to use two REST API calls to get the builds:
that are finished and failed
that are running and failing

Resources