Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11 stuck on archiving

Tags:

xcode

ios

xcode11

I‘m using Xcode 11 GM 2 to archive my app. It uses CocoaPods and Swift. When trying to archive my app, it infinitely gets stuck here: error This still happens after removing Firebase or other frameworks. Any ideas on how to resolve this?

like image 906
thatmarcel Avatar asked Sep 18 '19 22:09

thatmarcel


People also ask

Why I can't archive in Xcode?

Archive menu option grayed out If you can't create an archive in Xcode, usually it's because you have the destination set to the simulator. Switch to an iOS device (it should work even if you don't have one connected). Another cause for the grayed-out archive option is that it's disabled for your scheme.

How do I turn off archive in Xcode?

On the Xcode menu, select Product -> Edit Scheme... In the Build section, add the new target, then uncheck all the boxes except the one in the Archive column. This ensures the script will only be run on Archive. (See this question for an explanation and a nice screenshot.)

What is Xcode archive?

Archive: As its name says, it is the overall package (that contains . app and other related files). From archive you can create . IPA file similar to . apk file (android) with that you can distribute your application.


2 Answers

This could help (I was having an issue with SwiftSoup, another CocoaPod). I was experiencing inexplicable hangs while trying to get Xcode 11 to archive my app (even at the command line). This is not meant to be a permanent fix, but rather a temporary workaround (in other words, we shouldn't have to do this to get a problematic library to build)!

Add this to the bottom of your Podfile and re-run pod install.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    next unless target.name == '<NAME OF POD>'
    target.build_configurations.each do |config|
      next unless config.name.start_with?('Release')
      config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
    end
  end
end

Then try to archive your project. If that doesn't work… perhaps try messing around with other compiler optimization settings?

like image 59
Ben Kreeger Avatar answered Sep 27 '22 23:09

Ben Kreeger


I have found a clean and quick solution in the meantime, click "Pods" in the project navigator, then in targets (picture) set SwiftSoup,

enter image description here

In Swift compiler set both -Onone. Now try to archive.

enter image description here

like image 35
aph340 Avatar answered Sep 27 '22 23:09

aph340