Xcode 8:使用 iOS 9.3 基础 SDK 编译? [英] Xcode 8: Compile with iOS 9.3 base SDK?

查看:28
本文介绍了Xcode 8:使用 iOS 9.3 基础 SDK 编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Xcode 8.0 beta (8S128d) 中将我的 iOS 应用升级到 Swift 3.0.我以为一切准备就绪,然后将其上传到 iTunes Connect.当我点击提交审核"时,它给了我 26 个错误的列表,每个嵌入式框架一个,例如:

<块引用>

无效的 SDK 值.为 MyApp.app/Frameworks/libswiftFoundation.dylib 中 LC_VERSION_MIN_IPHONEOS 的 sdk 部分提供的值为 10.0,大于允许的最大值 9.3.2.

最后一个错误:

<块引用>

新应用和应用更新必须使用公共 (GM) 版本的 Xcode 6 或更高版本、OS X 和 iOS SDK 构建.请勿提交使用 Beta 版软件(包括 Beta OS X 版)构建的应用.

好的,在我升级我的应用程序之前知道这会很有帮助!我将如何提交此应用程序?

<小时>

我注意到通过复制

解决方案

遗憾的是,Xcode Beta 中似乎没有更改 SDK 版本的方法;这可能是一个错误,也可能只是因为 Apple 希望您将 Beta SDK 与 Beta 软件一起使用.就像@l'L'l 所说的,必须在稳定的 Xcode 中打开应用程序才能让 App Store 接受提交.

但是,我确实发现将项目降级到 Swift 2 并不是特别困难.通过手动修复 Xcode 7.3 中的所有错误,我只花了一个小时就降级"了整个项目.如果它对任何人都有帮助,我在此过程中注意到的主要模式是:

  • 将函数声明更改为在第一个参数之前没有 _,因为第一个参数在 Swift 3 中不是匿名的
  • 从所有函数调用中删除第一个参数标签,这有时涉及重命名函数(包括在委托中,有时不报告错误)
  • 更改几个内置属性,例如 label.isOnlabel.on
  • 在几个对象名称前添加NS,比如NSData和NSTimer,在Swift 3中分别变成了Data和Timer
  • 降级"故事板通过重新保存它
  • 使用 Xcode-stable 编译但使用 Xcode-beta 上传;Xcode-stable 对我的配置文件有问题,但事实证明,您使用哪个版本从 Organizer 上传二进制文件并不重要

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?

解决方案

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

这篇关于Xcode 8:使用 iOS 9.3 基础 SDK 编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆