33

Today I tried to archive and upload a App to iTunes Connect Beta Testing.

enter image description here

Xcode stays at the point "Copying Swift standard libraries" for about 10 minutes.. Two days ago it just were some seconds.. The CPU runs at 100% an the Fan is really really loud. it never did that before..

Then I try to upload it to the AppStore using the Organizer. But it stays ridiculously long at "Preparing Archive - Codesigning libswiftAVFoundation.dylib..."

enter image description here

I left it over night and it still was at the same spot.. I really don't know what to do. I need to upload this build as soon as possible.... Please help me somebody..

Edit: my setup: MacBook Pro Retina 13 2014, macOS 10.12.1 Beta

Luke Pistrol
  • 1,199
  • 3
  • 12
  • 26
  • Do you by any chance have McAfee anti virus installed? – HAS Oct 08 '16 at 16:27
  • No. and Never had – Luke Pistrol Oct 08 '16 at 16:28
  • Okay perfect :) – HAS Oct 08 '16 at 16:31
  • Why? Does it affect Xcode ? – Luke Pistrol Oct 08 '16 at 16:33
  • Does it still work for the code version before your current changes? – M_G Oct 08 '16 at 16:34
  • @M_G it does not work for any app I want to upload – Luke Pistrol Oct 08 '16 at 16:34
  • 1
    I experience the same issue. it codesign Swift project very slow. I have ObjC project – it works as usual. But both of them slowly codesign to device. I see in Activity Monitoyr about 8 processes of codesign with 100% each of processor item. Still looking for solution. – invoodoo Oct 08 '16 at 18:48
  • 1
    @LukePistrol try to create new user and compile from it. Just tried and found that it works in new user. Keep looking how to fix on my user. ) Hope it helped you for now at least. – invoodoo Oct 08 '16 at 19:17
  • @AntonAnisimov I will try that! I already thought about that – Luke Pistrol Oct 08 '16 at 19:18
  • @AntonAnisimov it worked! Thank you! I'll go this way for a while now – Luke Pistrol Oct 08 '16 at 19:53
  • @LukePistrol you're welcome. I wrote to Developer Support @ Apple hope they can help to figure out the issue. I'm still didn't figure out. I delete Xcode, caches, preferences – it didn't help. – invoodoo Oct 08 '16 at 21:18
  • @AntonAnisimov I also deleted it and cleared everything but it wasn't helping. But a new user does... thank you anyways you saved me ! – Luke Pistrol Oct 09 '16 at 07:16
  • @LukePistrol Yes, we have / had the problem that the new version activated [GTI](http://www.mcafee.com/ca/threat-center/technology/global-threat-intelligence-technology.aspx), and the "file reputation" part made compiles take up to 15 times longer (because it couldn't find the GTI server during the build and blocked the files until it timed out). – HAS Oct 09 '16 at 10:30
  • Still having this issue... – ken Oct 26 '16 at 13:07
  • I have the same issue, anyone got any updates? – Jan Misker Oct 26 '16 at 16:11
  • I'm seeing the same thing with Xcode 8.2.1, but I don't have the certificate issue mentioned in the answer below. It takes ~5 minutes to build and prepare a fairly small app for submission, I wonder if the "Preparing Archive" piece is the new bitcode improvements, and they're offloading some processing to the client? – Craig Otis Feb 20 '17 at 00:34

2 Answers2

45

I found the solution:

  1. Open Keychain
  2. Search for AppleID certificates (I found 1300+ of them)
  3. Delete all of them

Enjoy your fast-blast building with Xcode 8+! It seems like this is an issue with automatic signing feature from Xcode8.

invoodoo
  • 3,905
  • 1
  • 18
  • 16
  • My build to device times went from 10 seconds to 10 minutes and this also worked for me. It would hang on "Copying Swift standard libraries" – Dan Hixon Nov 03 '16 at 22:57
  • 4
    I have about 45-75 minutes per regular app. It made me insane – invoodoo Nov 04 '16 at 22:38
  • 5
    The "export" step takes over 20 minutes for my app. Of which the "Preparing archive" step took ages. I took a look in my key chain, and I do not have many certificates. I am on macOS Sierra 10.12.1, Xcode 8.1 (8B62) running on my late 2014 Mac Mini. The same step takes less than 1 minute on my early 2015 Macbook. – Sajjon Nov 07 '16 at 11:05
  • 1
    Turns out I indeed had many certificates! 360 certificates in a keychain named "Portal", generated by OS X Server. Seems like that is the culprit! Maybe caused be "automatically managed certificates" default setting in Xcode... Need to investigate! – Sajjon Nov 07 '16 at 12:55
  • This saved a lot of time! – David L Nov 20 '16 at 02:28
  • 2
    Didn't have so many certificates. I had only 2. Still takes ages. – Chanchal Raj Nov 25 '16 at 16:11
  • kill them all. Might be 2 is also enough to take it forever – invoodoo Nov 26 '16 at 19:38
  • down to 1 certificate (from 2 originally) - still takes about 30 minutes to codesign the app with barely 5 additional frameworks :( – alghanor Dec 09 '16 at 19:49
  • delete all, xcode will recreate it, but it should work. – invoodoo Dec 13 '16 at 00:35
  • I had the same problem with my iMessage extension. Enable automatic signing has generated over 1000 private and public keys named iMessage. – vmeyer Dec 27 '16 at 14:44
  • 1
    When you say: "AppleID certificates" - do you mean just search for "AppleID certificates" or are you typing something specific, can you please give an example? – Chris Jan 04 '17 at 15:00
  • Attempting to delete all yields the following warning. Did you get this warning as well? It's okay to ignore it? `Warning! One or more selected items is a private key. If a private key is deleted, certificates associated with that key can no longer be used.` – Crashalot Jan 06 '17 at 08:39
  • @Crashalot yeah, ignore it. It's ok, it will recreate it from scratch but only the 1 certificate + key. – invoodoo Jan 07 '17 at 18:38
  • 1
    @Chris all that found by keyword "appleid" – invoodoo Jan 07 '17 at 18:40
  • 1
    I don't have single "applied certificate" and it shows 0. Not sure where you have got 1300 – Vinod Mahale Feb 03 '17 at 12:23
  • @VinodMahale take a look here, I had here before 1300 of them, not only one: http://drops.invoodoo.com/KX84 – invoodoo Feb 03 '17 at 16:19
  • 1
    Thanks for screenshot but I don't have such certificates in my case so don't know how I can make it fast to archive. – Vinod Mahale Feb 08 '17 at 04:42
  • @vmeyer I have iMessage Encryption Key and those are 3272 in keychain. Do I need to delete those ? do you have deleted same files from your keychain ? – Vinod Mahale Feb 08 '17 at 04:59
  • @VinodMahale : Yes, delete the 3272 iMessage Encryption Key from your keychain. You should only have one Encryption Key by provisioning profile, and if automatic signing is activated, Xcode will recreate the iMessage Encryption Key. – vmeyer Feb 09 '17 at 08:52
  • @vmeyer : are these iMessage Encryption Key keys are related to any particular Xcode project ? any disadvantage of deleting it ? and how to disable automatic signing for Xcode 8? – Vinod Mahale Feb 10 '17 at 10:15
  • @VinodMahale : These iMessage Encryption Keys are generated automatically by Xcode for each iMessage provisioning profile you use. If you don't delete them, archiving your project will still take too long. Moreover, there is no disadvantage of deleting them, there will be re-generated. To disable automatic signing in Xcode 8, just uncheck "Automatically manage signing" in your iMessage target general tab. – vmeyer Feb 10 '17 at 10:59
  • @vmeyer : I tried deleting those iMessage Encryption Keys but still I same result. No improvement and it takes long time to archive. Is it issue with RAM memory of mac ? – Vinod Mahale Feb 16 '17 at 10:38
  • @VinodMahale : Maybe you have an other issue. If you don't have many duplicated keys or certificate in your keychain, you should post a new question on stack overflow. – vmeyer Feb 17 '17 at 10:55
  • this works for me. it took about 5 mins to finish archive, codesign, and upload after deleting the certificates. (it was 20 mins before) – Leo Feng May 29 '17 at 16:41
-3

Right click your Archive and select "Show" in Finder Then again right click on the resulted file in Finder and select "Show Package Contents" Then from the result open the product folder --> Application folder --> and select the ".app" file Then simply add this .app file under apps of iTunes software on Mac After completing the adding process right click on the app icon in iTunes and show in Finder, which will give you the iPA file.

Vinod Mahale
  • 374
  • 4
  • 14