安装Xcode 11后无法在模拟器上运行应用程序-CFBundleVersion错误 [英] Cannot run application on simulator after installing Xcode 11 - CFBundleVersion error

查看:448
本文介绍了安装Xcode 11后无法在模拟器上运行应用程序-CFBundleVersion错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我下载了Xcode 11的Beta版.之后,我打开了我的项目,并尝试使用新的Xcode运行.不幸的是,消息出现了错误:

Yesterday, I've downloaded beta version of Xcode 11. After that, I've opened my project and tried to run with new Xcode. Unfortunately error has occurred with message:


Failed to install the requested application
Domain: NSPOSIXErrorDomain
Code: 22
Failure Reason: The application's CFBundleVersion is invalid.
Recovery Suggestion: Ensure your bundle contains a CFBundleVersion with a valid semantic version number.
--

我已经关闭Beta版,并尝试使用Xcode的最新稳定版本(10.2.1)再次运行,但是发生了相同的错误.我需要提及的是,在尝试使用Xocde 11运行项目之前,该项目在Xcode 10上运行时没有任何问题.

I've closed beta version and tried to run again with latest stable version of Xcode (10.2.1), but the same error has occurred. I need to mention that before attempting to run a project with Xocde 11, it worked without any problems on Xcode 10. Nothing has been changed before and after running with beta Xcode.

我已经尝试过的:

  • 我已经删除了Xcode 11 beta
  • 我已经清理了我的项目,并将其从最新的分支机构中撤出
  • 我已经从以下位置完全删除了Xcode 10:
~/Library/Caches/com.apple.dt.Xcode
~/Library/Developer
~/Library/MobileDevice
~/Library/Preferences/com.apple.dt.Xcode.plist
/Library/Preferences/com.apple.dt.Xcode.plist
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.bom
/System/Library/Receipts/com.apple.pkg.XcodeExtensionSupport.plist
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.bom
/System/Library/Receipts/com.apple.pkg.XcodeSystemResources.plist

  • 然后安装新的稳定版本10.2.1
  • 我可以运行其他未经Xcode 11测试的项目,而不会出现任何问题.

    I can run other projects which was not tested with Xcode 11 without any problems.

    我的最后一个想法是只重新安装macOS,但我不想这样做.

    My last idea is to just reinstall macOS, but I would like to don't do it.

    我忘了提及该应用程序正在实际的iPhone XS上运行.

    I’ve forgot to mention that application is working on physical iPhone XS.

    推荐答案

    此处的答案中存在很多错误信息,因此我想提供权威的答复.

    There is a lot of misinformation in the answers here, so I wanted to provide an authoritative response.

    这里的问题是,带有Xcode 11 beta的CoreSimulator.framework新版本在CFBundleVersion上进行了验证,而以前的版本则没有.这些检查是有效的,并且确实代表您的应用程序中的问题,但是在Xcode 11 Beta 1中执行检查的方式也存在一个错误,这使问题更加复杂.

    The issue here is that the new version of CoreSimulator.framework with Xcode 11 beta does validation on CFBundleVersion that previous versions did not do. These checks are valid, and it does represent an issue in your application, but there's also a bug in how the checks were performed in Xcode 11 Beta 1 which compounds the issue.

    首先,在您的Info.plist中修复CFBundleVersion.它应该仅由数字组成,并且最多可以包含两个句点(即##.[.## [.##]],例如:12.4.2).

    First, fix the CFBundleVersion in your Info.plist. It should consist of only numbers and up to two periods (ie ##.[.##[.##]], eg: 12.4.2).

    第二,修复CFBundleVersion之后,您需要killall -9 CoreSimulatorBridge,因为很遗憾,旧值已缓存在CoreSimulatorBridge中,从而阻止了它识别新值.这部分是一个错误,已在Xcode 11 Beta 2中解决.

    Second, after fixing CFBundleVersion, you need to killall -9 CoreSimulatorBridge because the old value is unfortunately cached in CoreSimulatorBridge, preventing it from recognizing the new value. This part was a bug, and it was addressed in Xcode 11 Beta 2.

    这篇关于安装Xcode 11后无法在模拟器上运行应用程序-CFBundleVersion错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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