VSTS
buildNo :- 20171218.7
Agent :- Hosted macOS Preview
When I try to build a xamarin IOS project in VSTS I am getting the following error. Xamarin.iOS task failed with error Error: /Library/Frameworks/Mono.framework/Versions/Current/Commands/xbuild failed with return code:
I followed this tutorial :- https://docs.microsoft.com/en-us/vsts/build-release/apps/mobile/xamarin?tabs=vsts
Errors:
/Users/vsts/agent/2.126.0/work/1/s/JESS/JESS - Mobile/EmployeeApp.sln (default targets) ->
(Build target) ->
/Users/vsts/agent/2.126.0/work/1/s/JESS/JESS - Mobile/iOS/EmployeeApp.iOS.csproj (default targets) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets (_DetectSigningIdentity target) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets: error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com.
774 Warning(s)
1 Error(s)
Time Elapsed 00:02:29.6834100
Xamarin.iOS task failed with error Error: /Library/Frameworks/Mono.framework/Versions/Current/Commands/xbuild failed with return code: 1. For guidance on setting up the build definition, see https://go.microsoft.com/fwlink/?LinkId=760847.
@dan0131: The error indicates you haven't provided an iOS signing certificate (.p12). You can use the "Install Apple Certificate" task to install this prior to running Xamarin iOS task.
Thanks,
Madhuri
Hey @madhurig, I have the same issue. I provided a valid signing certificate (works on local mac too) but the error still exists.
Can you provide debug logs from your build to help investigate? You can email them to me - madhurig at microsoft.com.
@madhurig I will, thx for your support.
By the way, I followed Jame's tutorial (https://blog.xamarin.com/continuous-integration-for-ios-apps-with-visual-studio-team-services/) and used an onpremise macbook as a build agent and it worked like a charm with the same certificate and provisioning profile which I provided to the hosted macOS build agent.
@madhurig I'll check it Thanks :)
This still seems to be an active issue - I am experiencing the same problem as @jensf-sidious on a hosted build agent. Surely this renders the hosted build agent useless for creating iOS builds if signing doesn't actually work?
@clawrenceks: We are unable to repro the issue and have signing working on the Hosted macOS VMs. Can you check from your task settings if you are using "xbuild" or "msbuild" as the build tool? Are you explicitly using the "Default keychain"?
Thanks,
Madhuri
@madhurig I am using msbuild as the build tool. The steps that I followed were from the James Montemagno blog at https://blog.xamarin.com/simplified-app-signing-secure-files-visual-studio-team-services/
I have now got the build working by using the Identifiers option and specifying the signing identity, rather than leaving the certificate path and key empty as suggested in the blog.
Closing since Xamarin iOS task has been updated to use signing assets from secure files similar to Xcode task. The certificate and key path are no longer inputs on the Xamarin iOS task.
Most helpful comment
By the way, I followed Jame's tutorial (https://blog.xamarin.com/continuous-integration-for-ios-apps-with-visual-studio-team-services/) and used an onpremise macbook as a build agent and it worked like a charm with the same certificate and provisioning profile which I provided to the hosted macOS build agent.