Cocoapods: Could not archive a build from Xcode until I deleted the [CP] Prepare Artifacts script

Created on 20 Aug 2020  Â·  12Comments  Â·  Source: CocoaPods/CocoaPods

Report

I've had an issue for a while where I couldn't archive a build from Xcode until I explicitly removed the [CP] Prepare Artifacts script from the Build Phases section of my project and was able to successfully archive a build after doing so.

My question is, is it _absolutely necessary_ to have the [CP] Prepare Artifacts script in my project?

What did you do?

Removed the [CP] Prepare Artifacts script from the project.

What did you expect to happen?

I wasn't sure what would happen but thankfully, I was able to archive a build.

What happened instead?

I successfully archived a build from Xcode version 11.6

CocoaPods Environment

Currently running Cocoapods version 1.9.3 on my machine.

All 12 comments

@amorde didnt this script go away? Is it an artifact of the prior release that we can force 1.10 to always remove?

Yes but this report is based on 1.9.3

I am not sure what the issue is then. @alex-x-x-x-x can you upload a sample app demonstrating the issue?

@dnkoutso @amorde I'd also like to add that my colleague has been able to archive a build from Xcode with the script in the project this entire time. There's 0 to no difference between our Xcode configurations but I wonder if he probably hasn't ran pod repo update in quite some time (if ever) so that may be why he hasn't experienced any archiving issues.

I'm obviously just speculating but would be curious to know what the clear distinction would be between his ability to successfully archive with the script and my inability to archive with the script in the project until I remove it..

I am not sure what the issue is then. @alex-x-x-x-x can you upload a sample app demonstrating the issue?

Yeah, sorry I can't do that @dnkoutso.
Perhaps I can provide some screenshots with redacted proprietary information?

Maybe those will help but its hard to guess what is going on here with the current information. Help is needed from you to diagnose why.

Also try 1.10.0.beta which doesnt have this script phase and maybe this issue is no longer an issue.

There are some known issues with the prepare artifacts script that were fixed in the 1.10 beta. I'd highly recommend trying the beta.

@dnkoutso @amorde Fair, I'll try it out in a few hours with and without the build script and report back here.
If using 1.10.0 beta allows me to archive a build with the [CP] Prepare Artifacts script in the project, I'll comment and close the issue. Sound good?

However, it seems that the prepare artifacts script is of no issue for my colleague so I wonder how the bug skipped him considering he's running cocoapods 1.9.3..

not sure either. Yes it should be OK to close if its fixed in 1.10.0.beta.

Betas in CocoaPods should be fine to archive. Its not like in Xcode where you cannot submit an archive from an Xcode beta.

Starting in 1.10 the Prepare Artifacts script no longer exists

@amorde @dnkoutso
Thanks for your help yesterday; we decided that we're going to remove the [CP] Prepare Artifacts script from the project altogether.

Coincidentally, my colleague ended up having issues with building the project after updating a library.
He updated the versioning from the Podfile and subsequently ran a pod install, though I know the preferred means is to run pod update [pod name].
After removing the [CP] Prepare Artifacts script he was able to successfully compile the project.

I didn't bump my Cocoapods version to 1.10 beta as I wasn't sure if it would create issues in our CI/CD tooling as we have a Cocoapods Install step in our workflow -- however if you have any insight on this & know 1.10 beta wouldn't be an issue then I'm more than happy to close this opened issue.

Just thought I'd provide the above update so you guys have a heads up in case this bug comes up again for someone else.

Also, if the script is being removed for 1.10 GM, what will the substitute be to include .xcframework into the app bundle? Let me know if you have any workarounds or suggestions regarding this.

@alex-x-x-x-x thanks for the investigation here. I think we will close this for now given that 1.10 stable is about to ship.

Please re-open this issue or a new one if 1.10 ships and you see problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spencerkohan picture spencerkohan  Â·  3Comments

Curtis-Halbrook picture Curtis-Halbrook  Â·  3Comments

hmistry picture hmistry  Â·  3Comments

steffendsommer picture steffendsommer  Â·  3Comments

soleares picture soleares  Â·  3Comments