Exception: CopyFilesBuildStep.ExecuteStep can't create Contents

Anyone ever see this error and know how to fix it? All of a sudden I can tbuild a project that was building along nicely…

Which OS? Which version of which OS? Which version of Xojo?

What are you trying to copy? Are the files there that you want to copy? Where do you want to copy the files to? Have you tried to delete the CopyFiles and add it back?

MacOS Ventura 13.2, Xojo 2023r4. Im copying 9 json files from a folder inside the project directory to the App.Resources folder. In the App, I copy them to the user’s ApplicationData folder for actual use. This has been working for a long time and just all of a sudden I cant compile, I get that error twice with each having the options; Report or Ignore and then I get a withered 394k build image thats messed up and obviously doesnt work. I do also get an error related to my signing cert being bad - Error signing application: Warning: unable to build chain to self-signed root for signer "Apple Development: Sean Arney and it does say somting regarding Gziplib. The app runs fine when just run in the debugger.

This sounds like you have worse problems than a copy files build step. I suggest restarting your computer first if you haven’t done that. Then use the certificate diagnostics in AppWrapper to check your certificates.

Remove the json files and build your app. Only when this works try adding them one by one.

I don’t like to use the copy files step because there are no errors when the files are missing. Instead I prefer to use shellscripts with ditto.

I rebooted previously with no difference. Ive deleted and reloaded the copy step with no change. Now I deleted the copy step and json fies altogether and now the build gives me the below error - and no build object at all but doesnt show the copy step errors…Im not current on AppWrapper but it seems to be choking on my cert for some reason but it doesnt seem the two are related because it has been doing the cert error for a few months but still prodcuing a build.

Error signing application: Warning: unable to build chain to self-signed root for signer “Apple Development: Sean Arney (5DFP4E79X7)”

/var/folders/qw/q1cr58155n90545b48r_s7nr0000gp/T//XojoTempSigning: errSecInternalComponent

In subcomponent: /private/var/folders/qw/q1cr58155n90545b48r_s7nr0000gp/T/XojoTempSigning/Contents/Frameworks/libGzip.dylib

Sean,

Is your copy files step before or after the signing step?

Errors like this typically happen when you have an expired certificate on your machine. IIRC, one of Apple’s root certs expires sometime this year so it may be just that.

IIRC, the easiest way to solve this is to go to this page:

https://www.apple.com/certificateauthority/

And to download & install any of the G3 and G5 certs listed on the page (roots & intermediates)

Its after. I have removed the copy step and am having cert problems with expirations so I will try the below

I downloaded every cert that showed G3 or G5 in the list but now what?

Have you installed them?

apparently not. Is there instructions anywhere? All I am seeing is some vendor specific stuff from digicert.com

Do the new certs show up in your keychain?

no they dont

Then you haven’t installed them. I tried that by double-clicking, and KeyChain loaded them. But there is another component, your private key or something, that has to mate with it. I had to do this late last year and somehow, magically, Xcode created me a private key (from where? My armpit? Who knows) and suddenly all was well.

I can’t pretend to understand this stuff, and was floundering around in the dark at the time, so have no real idea of what I actually did to make it work. No one ever explains the real questions, like What is a private key, why would I need one, how do I create one, and where do I put it, and how do I make it interact with a public key item, such as the cert I just dowloaded.

Someone more knowledgeable will be alomg shortly, I hope.

1 Like

Ok, I tried the double clicking and installing the G3 and G5 certs which made them show up in keychain so Im assuming that was successful. Ill try the xcode ‘magic’ route since I got a fresh copy of AppWrapper and its shows; my certs have invalid “Trust” settings or are slef signed, and that my private keys are missing from Dev ID App & Dev ID Installer. Im not sure why all this just suddenly happened but it sure is not fun

Start by double-clicking the certs you downloaded.

Next, put your copy files steps before the sign step. Adding files afterwards will break the signature.

If you’re still having signing issues, try removing your developer ID from the sign step and see if you can build. It’ll use a self-signature just so you can run. If that works, you’ll need to go back to the Apple developer portal and reissue your developer cert. that means deleting the old one and creating a new one from scratch because Apple doesn’t keep the private portion.

1 Like

Thanks for the sentiment Tim, I am feeling like Im completely in the dark here and there doesnt seem to be any docs or cohesive info out there…it feels like developer hazing. Im no pro but Im not exactly new to this either so someone hobby developing - yikes

It built without my dev ID in the sign step - so thats a breath of fresh air. Thankl you very much for that Greg. I will now maybe delete all the certs fromt eh leychaion and redownload my apple certs and repeat the process. One thing Im wondering is they originally came into keychain with the “Trust” problem so I double clicked them in the keychain app and changed the trust to “Always Trust”. That fixed the trust issue but not the “Missing Private Key” for Dev and Install. Then I also have

2023-02-07 System !Certificate Is Expired; “Apple Worldwide Developer Relations Certification Authority”
and

Unknown	 "Developer ID Certification Authority"	1763908746353189132

also in the AppWrapper Code Signing Diagnostic report

Don’t worry. We all feel like that now and then. My contracts had expired 2 weeks ago. Then I needed to check some dumb checkbox in XCode for who knows what. Until I had everything working again it took 2 hours.

I think this is done on purpose. Like the extra nasty ideas they had for the Europan app store.

1 Like

You can’t just redownload them. Signing keys have two parts, a private key and a public key. Both keys are created when you make a new certificate and immediately downloadable, but once you leave that page, Apple no longer has a copy of the private key. If you download again, you’ll only get the public key part.

Private keys are used for the actual signing whereas the public keys are used for verifying that the signatures are valid. You should only install the private key on computers that you trust, which are allowed to sign software in your name. that is why Apple doesn’t keep a copy, because they also shouldn’t be able to sign an app as if they were you.