Xcode Bots:: Creating archive failed: xcodebuild exited with status 65 - xcode

My integration succeeded but archive fails every-time with following warning mentioned below -:
**Warning: Build Service Error:** Creating archive failed: xcodebuild exited with status 65.
**Warning: Build Service Error:** Skipping exporting from archive because creating the archive failed.

I had the same problem. In my case the code signing was set to automatic. When I change it to an distribution certificate it worked.

I was having this issue after updating to the Server beta. I was able to fix it by adding my team to the Xcode server settings.

Its a problem of certificate. Try to check if you have the certificate on your machine corresponding to the build you want to make.

Related

Run tests with xcodebuild without signing

What I'm trying to do
I'm trying to run several tests written in the XCTest framework without code signing, for the purpose of not having to deal with the hassle of importing code signing identities on CI.
What I've tried
I've removed the development team and set the signing certificate to "Sign to run locally" for both the app and test target. Building with
xcodebuild build-for-testing -scheme <my scheme>
works on both CI and locally, but attempting to run the tests with
xcodebuild test-without-building -scheme <my scheme>
fails after around 10s with the error <name> (83559) encountered an error (Failed to load the test bundle.. <test binary> not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc? a few lines down sheds more light about the issue. Seems like macOS didn't like the unsigned test bundle and refused to load it.
Running the test command like so:
xcodebuild test-without-building -xctestrun /Users/vinkwok/Library/Developer/Xcode/DerivedData/ChessFrontend-carjpisbuprsabeulpsycoxjqjea/Build/Products/ChessFrontend_macosx13.0-arm64.xctestrun -destination "platform=macOS,id=<id>,arch=arm64"
throws the following error:
Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: The test runner exited with code 1 before checking in. ...)
It looks like the same test bundle error is occurring, except this time it's not printed out because the test runner simply failed to start.
I've also attempted to sign the test bundle with my development cert with codesign, but that just caused xcodebuild test-without-building to complain that the bundle was missing a development team.
Could anyone point me in the right direction about how to run tests on CI environments without the hassle of dealing with signing and code signing identities? Answers would be greatly appreciated!

Ionic 5 / Appflow - Preparation failed during iOS Xcode 11 build

I’ve an error when I build with iOS Xcode 11 on Ionic Pro Hub.
I do not know if the problem comes from Ionic Appflow, or from the code that I build. The problem appears in the build console of Ionic Hub Appflow.
Running with gitlab-runner 10.2.0~beta.147.gbd1f3fcb (bd1f3fcb) on
ip-10-2-128-50 (c93ac604) Creating new VM… ERROR: Preparation failed:
The name ‘runner-c93ac604-project-0-concurrent-0’ already exists. Will
be retried in 3s … Creating new VM… ERROR: Preparation failed: The
name ‘runner-c93ac604-project-0-concurrent-0’ already exists. Will be
retried in 3s … Creating new VM… ERROR: Preparation failed: The name
‘runner-c93ac604-project-0-concurrent-0’ already exists. Will be
retried in 3s … ERROR: Job failed (system failure): The name
‘runner-c93ac604-project-0-concurrent-0’ already exists.
That error message says it is a system failure.
Is this on a self-managed GitLab instance? Or a self-managed GitLab Runner server?
I notice the GitLab Runner version is out of date compared to what's on gitlab.com.
My jobs this morning on gitlab.com say:
Running with gitlab-runner 12.9.0 (4c96e5ad)
You have version 10.2.0~beta.147.gbd1f3fcb (bd1f3fcb)
Can you update to latest stable GitLab Runner?

Nativescript Sidekick Publish to App Store

I'm running Sidekick on my Windows 10 machine (64b).
I'm trying to publish my app to the Apple AppStore.
Certificate, provision is all ok.
When I publish, build is made, I can log in when asked and fill in the verication code.
But then I get error 'Spawn Failed'. Googled this error, but didn't find anything.
Erros in the log are:
[19-03-08 10:52:20.711] (CLI) Build machine host name:
administrators-Mac-16.local
[19-03-08 10:52:58.349] Spawn failed.
, Error: Spawn failed.
at CloudPublishService.getiOSError (C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:79:21)
at CloudPublishService.
(C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:96:29)
at Generator.next ()
at fulfilled
(C:\Users\bartad\AppData\Roaming.nativescript-cli\extensions\node_modules\nativescript-cloud\lib\services\cloud-publish-service.js:4:58)
at
Does anyone have an idea what's wrong here ?
Thanks
Bart
Issues I encountered:
1) Provisioning was not right. Went back through and checked that each step is for a Distribution certificate and profile, not a development profile.
2) I assumed that tns resources generate would create my icons and splashes. It did, but Sidekick ignores them. You must recreate them in Sidekick.

Appcelerator [ERROR] : Invalid "--pp-uuid" after provisioning certificate update

I'm new to Appcelerator and Stackoverflow, so pardon my ignorance.
I have just updated my iOS provisioning certificate and now I get the following error. Any ideas? I'm using SDK 5.0.0.GA and studio build 4.0.0.
[ERROR] : Invalid "--pp-uuid" value "d806f6cb-f67e-40e5-a9f3-88b8af3bcfae"
For help, run: titanium help build
2016-01-16T21:08:11.950Z | TRACE | titanium exited with exit code 1
2016-01-16T21:08:11.951Z | ERROR | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/rwhatcher/.appcelerator/install/5.1.0/package/node_modules/appc-cli-titanium/plugins/run.js:92:66)
at ChildProcess.emit (events.js:110:17)
at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
2016-01-16T21:08:11.952Z | TRACE | Sending exit signal to titanium process: 56550
Did you look at Run Configurations... menu. You can change provisions here. Make sure have green check all.
Good luck.
Welcome Robert, well you can try a fresh restart.
First look at your ~/Library/MobileDevice/Provisioning Profiles folder and delete the deprecated provisions.
Then you go to your membership Apple account and create a new certificate (dev/prod) and a new provision profile linked to the certificate and your app id (e.g device/production). Remember to open the files certificate/provision at least one time.
After all, run a appc ti clean at your project root followed by appc run -p ios -T device. The CLI will ask for you choose the certificate and provision, then you choose the new ones and then it should works.
Also check in your /library/mobileDevice/ProvisioningProfiles folder, this is where the files are located after you've downloaded them and double clicked.
Sometimes I find there are multiple versions of the same provisioning file and appcelerator isn't using the most up to date one. If you delete them, you'll need to download them again from ios dev center (this includes the development, distributon and app store files).

Code signing error running XCodeBuild in Jenkins

[Not a duplicate of similar questions as explained further down]
I'm getting a code signing error when running XCodeBuild from within Jenkins but it will build ok from the command line or from within Xcode.
Several people have had this problem in the past and the common theme with them is that Jenkins gets run at launch time as the daemon user and thus tries to access the system keychain.
The solutions that people have applied are copying credentials to the system keychain or running a command to set which keychain to use.
However in my case if I look at launchd in the Activity Manager the user is showing up as the user I am logged onto the machine as, therefore Jenkins should be running as this user and not as the daemon user.
I tried setting which keychain to use by adding this command to the Jenkins script before running XCodeBuild
security list-keychains -s /Users/[user]/Library/Keychains/login.keychain
But that did not solve the problem.
The error I am getting is:
Code Sign error: The identity 'iPhone Developer: NNNNN (9TYX5WAM63)' doesn't match any valid, non-expired certificate/private key pair in your keychains"
So I tried moving the credentials to the system keychain but now get this error in Jenkins, but its still fine from the command line:
Code Sign error: Provisioning profile 'F152C66E-B99A-47F6-B262-376CE4403D71' can't be found
Also when I move the credentials to the system keychain I am no longer able to build from within XCOde - I get the same error as the top error message above.
I've also tried editing the org.jenkins-ci.plist file to set the user as who I'm logged onto the machine as, in accordance with this, but that too had no effect.
Missing certificates and keys in the keychain while using Jenkins/Hudson as Continuous Integration for iOS and Mac development
Any ideas what I could try next?
I feel for you as the last time we messed with this it was quite the challenge. We did this when we set up a CI server for a project. If I remember correctly (broadly) we followed these steps:
1) Set Jenkins up as a developer on the Apple Dev account
2) Created a cert and dev provisioning profile specifically for Jenkins
3) Setup a Jenkins user on the CI Server and delete any previous certs/prov profiles from xcode for that user
4) Add the Jenkins cert to the AD-Hoc Dist Profile (If you are trying to distribute an .ipa to HockeyApp you will need to to this for an archive build.)
5) Go into the xcode project file and delete any existing references to Provisioning Profiles
6) Download and Install the certs for this user and the appropriate Prov Profiles.
7) Before the build unlock the Jenkins user keychain. Do this only if the Jenkins user is not the user running the xcode build.
Verify that Xcode shows the Prov Profile as valid in the organiser when logged in as the Jenkins user.
I know my answer is somewhat vague and my intent is to be helpful. This type of error is usually caused by one of three things. Xcode cant find the profile, Xcode cant find the cert or Xcode found more then one profile (supposed to produce a different error but doesn't always) and has a mismatch of some kind. Usually redoing the Prov Profiles is the least painful solution.
Best of luck man. You will solve it it's just a huge headache!
Probably not the answer you are looking for, but i gave up on the XCodeBuild plugin for a number of reasons, and running my build through "Execute Shell" step.
You said your command line build works, so you already know the commands that are required. Just put that into the shell.
xcodebuild -verbose -alltargets -configuration Debug clean build CODE_SIGN_IDENTITY="${CODE_SIGN_IDENTITY}" PROVISIONING_PROFILE=${PROVISIONING_PROFILE}
&&
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${WORKSPACE}/client_trunk/build/Debug-iphoneos/${Application}.app" -o "${WORKSPACE}/client_trunk/build/Debug-iphoneos/${Application}-Debug-${shortVer}.${revVer}.ipa" --sign "${CODE_SIGN_IDENTITY}" --embed "/Users/[youruser]/Library/MobileDevice/Provisioning Profiles/${PROVISIONING_PROFILE}.mobileprovision"
Above, ${CODE_SIGN_IDENTITY} is the one that looks like iPhone Developer: blah
And ${PROVISIONING_PROFILE} is the hex number for the profile like F152C66E-B99A-47F6-B262-376CE4403D71
Follow instruction on the Xcode Plugin home page :
If this prompt is not showing on the build machine, you can force it to appear by running the codesign command that failed from a terminal on the build machine: /usr/bin/codesign --force --sign "iPhone Distribution: .....
Execute failed signing command from the terminal as a Jenkins user and select "Always allow"
Using Jenkins I got this error:
/Users/Shared/Jenkins/Home/jobs/ExampleTabbed-Integration/workspace/build/Debug-iphoneos/ExamplesTabbed.app: User interaction is not allowed.
Command /usr/bin/codesign failed with exit code 1
I fixed it by doing the following:
Add Build Step before the XCode (jenkins plugin) step
Add the following as the execute command:
security unlock-keychain -p "passwordhere" ${HOME}/Library/Keychains/login.keychain
In the XCode (via plugin) configuration I'm using the following:
Unlock Keychaing ? (unchecked)
Keychain path: ${HOME}/Library/Keychains/login.keychain
Keychain password: (empty)
It might be possible to remove the pre-step and use the actual xcode config to do it, but it's working as described with no problems.
Note this doesn't take into account using a more secure solution yet, but this was my solution to the xcode signing issue. I'm running on OSX with the Jenkins installer and running as a launchctl command, used by the default Jenkins installer application. If that helps.
Subprocesses of Java/Jenkins will need to have unlocked access to the Keychain.
Let's say your build / code-sign / release process is working fine. The only blocker is when you try running the exact same process in Jenkins.
Chances are that the keychain is locked, not for the user, but for Jenkins sub-processes.
The security command to unlock the keychain will need to be run as a Jenkins job, just once. Even if the same logged in user has already unlocked the keychain in the terminal.
So setup a simple freestyle job in Jenkins and add the following shell command as a build phase.
security unlock-keychain -p $PASSWORD /Users/$MACOS_USER/Library/Keychains/login.keychain-db
Provide $PASSWORD as an input parameter for the Jenkins job.
$MACOS_USER the macos username of the Mac keychain owner.
Once you've run this job choose "Always Allow" from the keychain prompt. Now, try your regular build/release job & it should work. Assuming you have all the required certificates in the login keychain.
NEVER HARDCODE PASSWORDS INTO CONFIG/JOBS/CODE etc.

Resources