2

I upgraded my iOS app to Swift 3.0 in Xcode 8.0 beta (8S128d). I thought it was all ready to go and uploaded it to iTunes Connect. When I clicked "Submit for Review", it gave me a list of 26 errors, one for each embedded framework, such as:

Invalid sdk value. The value provided for the sdk portion of LC_VERSION_MIN_IPHONEOS in MyApp.app/Frameworks/libswiftFoundation.dylib is 10.0 which is greater than the maximum allowed value of 9.3.2.

And one final error:

New apps and app updates must be built with the public (GM) versions of Xcode 6 or later, OS X, and iOS SDK. Don't submit apps built with beta software including beta OS X builds.

Okay, that would have been helpful to know before I upgraded my app! How would I go about submitting this app?


I noticed about changing the project Base SDK from iOS 10.0 to iOS 9.3 by copying the base SDK from Xcode 7.3.1 to Xcode 8:

/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk

And then changing the Base SDK setting in Xcode 8's Build Settings. However, it didn't recognize the new SDK (see this question), even when I entered it manually, and compiled it with iOS 10.0 anyway. Is there any way to compile with the older SDK? Or must I roll back my code to Swift 2?

Xcode 8.0 Base SDK changing

Community
  • 1
  • 1
BradzTech
  • 2,755
  • 1
  • 16
  • 21

2 Answers2

5

Here's the quick solution:

Don't use Xcode beta versions to submit apps for release — it's beta for a reason and shouldn't be used with production code.

Submitting Apps

Apps that are created using beta versions of Xcode or that are built for beta versions of operating systems will not be accepted on the App Store and Mac App Store. Apps that you submit should be developed using the latest version of Xcode from the Mac App Store and should be built for publicly available versions of iOS, OS X, and watchOS — except when GM seeds are available. When a GM Seed of Xcode becomes available, use it to develop your app for submission. When GM seeds of iOS, OS X, or watchOS become available, build your app for these versions.

https://developer.apple.com/support/pre-release-software/

Re: Okay, that would have been helpful to know before I upgraded my app! How would I go about submitting this app?

Use the current or GM release of Xcode to build and submit your app.

l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • I understand that now! But I already upgraded to Swift 3, which Xcode 7.3.1 (latest stable version) doesn't recognize :\ My question is whether there is any way to link the Swift 3 project with the stable iOS 9.3 SDK? – BradzTech Jun 22 '16 at 01:03
  • 1
    Hopefully you were using source control i.e. Git then you could just rollback to your Swift 2 version. But before you do that make a backup of your Swift 3 version of course so you're ready to go later. Or maybe you use Time Machine? You could go back in time to your Swift 2 version. – Edison Jun 22 '16 at 01:11
  • @BradzTech: How many functions of your code are dependent upon Swift 3? – l'L'l Jun 22 '16 at 01:31
  • Nothing is "dependent"... pretty sure everything I did in Swift 3 can also be done in Swift 2. But opening the project in Xcode 7.3.1 comes up with hundreds of errors due to syntax differences. I would also lose quite a lot if I rolled back. I'll probably end up manually "downgrading" the syntax error by error if there isn't a better way. – BradzTech Jun 22 '16 at 01:46
  • i uploaded many times to testflight using xcode8 beta. but just today i started gettting this message. did they suddently stop allowing uploads from xcode8 beta? – alionthego Jun 23 '16 at 04:23
  • @alionthego: It's been their policy for a long time, and it might be a case where they've recently become more strict about things; in the past they seemed to be more lenient than nowadays. – l'L'l Jun 23 '16 at 04:26
  • i understand that policy applying to the app store for release but is it also the policy for testflight? what's the point of testing if you can't test beta? Also because of the huge differences with swift 3.0, reverting to xcode 7.3 is not really an option... Guess will just have to wait and see. – alionthego Jun 23 '16 at 09:39
  • 1
    TestFlight works for me. It all uploads fine, just error when you go to Submit the app for review. – BradzTech Jun 25 '16 at 02:47
2

Unfortunately, it doesn't look like there's a way to change the SDK version in Xcode Beta; it could be either a bug or just the fact that Apple wants you using the beta SDK alongside the beta software. Like @l'L'l said, one must open the app in stable Xcode in order for the App Store to accept the submission.

However, I did find that downgrading the project to Swift 2 wasn't exorbitantly difficult. It only took me an hour to "downgrade" the entire project by manually fixing all of the errors in Xcode 7.3. In case it will help anyone, the main patterns I noticed during the process were:

  • Changing function declarations to not have an _ before the first argument, because the first argument is not anonymous in Swift 3
  • Removing the first argument label from all function calls, which sometimes involves renaming the function (including in delegates, which sometimes don't report an error)
  • Changing a couple built-in properties, like label.isOn to label.on
  • Adding NS before several object names, like NSData and NSTimer, which became Data and Timer in Swift 3, respectively
  • "Downgrading" the Storyboard by re-saving it
  • Compile using Xcode-stable but upload with Xcode-beta; Xcode-stable had issues with my provisioning profiles, but it turns out it doesn't matter which version you use the upload the binary from Organizer
Community
  • 1
  • 1
BradzTech
  • 2,755
  • 1
  • 16
  • 21