Invalid Swift Support / The SwiftSupport folder is empty

前端 未结 19 1375
轻奢々
轻奢々 2020-12-08 13:01

Environment: Xcode 7 GM

I uploaded iOS app successfully using Xcode without error. This app is written in Objective-C and Swift.

However, immediately after s

相关标签:
19条回答
  • 2020-12-08 13:57

    Setting Always Embed Swift Standard Libraries to Yes is only necessary for Objective-C targets which link against your own frameworks which depend upon Swift. In cases where you are not linking against (i.e., using) an internal framework which depends upon Swift, Xcode will embed the Swift standard libraries in your archive as long as there is at least one occurrence of importing a Swift standard library in a Swift file which is part of the build target.

    In other words, if your target has a Swift file which doesn't import any Swift standard libraries––via "import Foundation", for example––then Xcode will not copy the Swift Standard libraries into the archive.

    The fix for this issue is to ensure that at least one of the Swift files in your target is importing a swift standard library (e.g., "import Foundation").

    Daniel Jalkut has a very informative post about Swift dependencies which sheds light into this issue.

    0 讨论(0)
  • 2020-12-08 13:58

    I grappled with this issue for a while and nothing above worked. In a last desperate attempt I just deleted the SwiftSupport folder from my archive.

    To my surprise it uploaded and completed processing successfully. Hope this help someone.

    0 讨论(0)
  • 2020-12-08 13:59

    Here's what I am doing now to solve this issue since my method above stopped working. Keep in mind that my code's main app is Obj-C and my watch app is Swift.

    1. Make sure the "embedded Content Contains Swift Code" is set to:
      • YES for app target
      • NO for WatchKit Extension
      • YES for Watchkit App
    2. After Archiving my XCode will not create the "[archive folder]/SwiftSupport/iphoneos", but will create and fill the "[archive folder]/Products/Applications/[app name].app/Watch/\ WatchKit\ App.app/Frameworks" with the Swift dylibs. So I created the following soft link:

      ln -s "[archive folder]/Products/Applications/.app/Watch/\ WatchKit\ App.app/Frameworks" "[archive folder]/SwiftSupport/iphoneos"

    Then when I submit via XCode Organize it is accepted without error.

    If you simply copy the files rather than linking them then you risk the watch app exceeding the 50MB limit.

    0 讨论(0)
  • 2020-12-08 14:02

    There are many conflicting answers on this page.. what worked for me was the one mentioned here, which is simply select a save for iOS app store deployment option (I'm actually not interested in an app store release.. I want to simply push a release for testflight internal testing)..

    that being said, I have a way to verify that your ipa will be approved or not before submitting it:

    • drag the .ipa file into a new folder (call it analysis)
    • right click the ipa file and rename it to .zip (confirm the dialog to use .zip)
    • double click the zip file

    here if you get a folder (with the same name as the .ipa file) that has the following subfolders in it:

    • payload
    • swiftSupport
    • Symbols

    then you are good to go, however if you only see the Payload folder within.. then you gotta try again

    also a couple of pointers

    • I've tried setting "Embedded Content Contains Swift Code" to NO, it worked just once then stopped working after that
    • I've ensured that I had no cocoapod errors.. that didn't help either
    • I've tried manually adding the SwiftSupport folder inside the archive as suggested here.. but then i got all sorts of side effects.. didn't work

    conclusion

    I think this is due to some bug with xcode (writing this with Xcode 8.0 build (8A218a).. so keep on trying your luck until it works.. just don't expect some solid explanation for it

    0 讨论(0)
  • 2020-12-08 14:03

    Using Save for iOS App Store Deployment instead of Save for Ad Hoc Deployment Xcode export option solved this issue for me. Counterintuitively, you should use the first option even for TestFlight builds.

    0 讨论(0)
  • 2020-12-08 14:04

    important note: this only works for projects that do not use swift, see comment below

    I just met the same issue and resolved it by making the following change - If you used to have Swift files in your project but then removed them, you only need to set "Embedded Content Contains Swift Code" to NO in Build Options.

    0 讨论(0)
提交回复
热议问题