简体   繁体   English

基本SDK缺失

[英]Base SDK Missing

I get the "BASE SDK Missing" when re-opeing projects. 重新执行项目时出现“ BASE SDK Missing”。 (I got the latest build of xcode, and latest SDK installed.) (我获得了最新版本的xcode,并安装了最新的SDK。)

It seems to be happening when I quit a project, (not exiting xcode), and re-open the project after a while. 当我退出项目(不退出xcode)并过一会儿重新打开项目时,似乎正在发生这种情况。 I have tried both, with and without my iPhone plugged in. I have tried to fix the problem like described here , but it does not help for me. 在插入和未插入iPhone的情况下,我都尝试过。我试图解决此处所述的问题 ,但这对我没有帮助。 - It just makes it even worse! -只会更糟! (unrecognizable SDK) (无法识别的SDK)

The only way I have managed to get it back to normal, is to do a manual re-boot of my mac, plugged in my phone, waited until it has checked my iPhone, and then, opened xcode. 我设法使其恢复正常的唯一方法是对Mac进行手动重新启动,插入手机,等待,直到检查完我的iPhone,然后打开xcode。 Time consuming and annoying! 费时又烦人!

Why does it happen and what is the trick to fix this? 为什么会发生,解决这个问题的诀窍是什么?

Your recent upgrade of Xcode likely removed the earlier SDK that your project was set to use. 您最近对Xcode的升级可能会删除您的项目设置为使用的早期SDK。 There are a couple of solutions for the problem. 有两种解决方案。 The most simple solution is to always select the "Latest" SDK in your project's settings and not select a specific option. 最简单的解决方案是始终在项目设置中选择“最新” SDK,而不选择特定选项。 You may be uncomfortable with the idea and want to run your app on an older device but it's important you understand that all of the newer SDKs can generate code that works on older versions of iOS. 您可能对这个主意不满意,想在较旧的设备上运行您的应用程序,但重要的是要了解所有较新的SDK都可以生成可在较旧版本的iOS上运行的代码。 There's a separate hard to remember option for setting the deploy target. 设置部署目标有一个很难记住的选项。 (It took me a while to learn how/why to use this but it's well worth it.) (花了我一段时间来学习如何/为什么使用它,但这很值得。)

The second option is to actually find a version of the SDK that your project is set to and attempt to reinstall it. 第二个选择是实际找到项目设置为的SDK版本,然后尝试重新安装它。 I suggest going this route only if necessary as it's not guaranteed to work in each case. 我建议仅在必要时才使用此路线,因为不能保证在每种情况下都可以使用。 Older SDKs may or may not work in later versions of Xcode (Eg. SDK 3.0 might not work in Xcode 4.3.2) due to major changes in the toolchains. 由于工具链的重大更改,较旧的SDK可能会在Xcode的更高版本中起作用,也可能无法起作用(例如,SDK 3.0在Xcode 4.3.2中可能不起作用)。 Tools like gcc/gdb are deprecated in favor of llvm/lldb. 不建议使用gcc / gdb之类的工具,而建议使用llvm / lldb。 Still, you may have a valid reason for using an older SDK. 不过,您可能有使用旧版SDK的正当理由。 You may have to fix a bug that is present only when using the older toolchain or you may need to reproduce a problem that only happens with builds generated from your build server. 您可能必须修复仅在使用较旧的工具链时才存在的错误,或者可能需要重现仅由构建服务器生成的构建才会发生的问题。 In many of these cases it might be easier to upgrade where the problem occurs (Eg. upgrade the tools on the build server) or downgrade your dev environment. 在许多情况下,可能更容易在发生问题的地方进行升级(例如,升级构建服务器上的工具)或降级开发环境。 (Install an older version of Xcode.) (安装较旧版本的Xcode。)

The reasoning behind the frustration is that Apple highly encourages rapid adoption of it's latest tools and technologies. 感到沮丧的原因在于,苹果强烈鼓励迅速采用其最新的工具和技术。 It creates a better product as the dev community is forced to stay current and competitive while the users are forced to maintain upgrades to ensure apps continue to work. 随着开发社区被迫保持最新和竞争力,而用户被迫维护升级以确保应用程序继续运行,它可以创建更好的产品。 This is in contrast with the traditional model of backward compatibility allowing developers to support revision -n of a product/platform. 这与传统的向后兼容模型相反,后者允许开发人员支持产品/平台的-n版本。 It is also great for business since rapid adoption of the latest often encourages purchase of newer hardware and products to get the best experience. 这对于企业来说也非常有用,因为快速采用最新技术通常会鼓励购买更新的硬件和产品以获得最佳体验。 The rapid adoption ensures the more robust software along with bug fixes, enhancements make it to the majority of consumers overall increasing their penetration in the market. 快速采用确保了功能更强大的软件以及错误修复,增强后的功能使大多数消费者总体上可以提高他们在市场中的渗透率。

You have to set your target and project's base SDK to "Latest" and not an explicit option. 您必须将目标和项目的基本SDK设置为“最新”,而不是显式选项。 If you choose one explicitly it seems to break if you update xcode versions. 如果您明确选择一个,则更新xcode版本似乎会中断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM