ios CFBundleVersion 必须高于之前的版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9754691/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CFBundleVersion must be higher than previous version
提问by Kenny Wyland
I'm submitting an update to one of my apps. I've done this dozens of times with the many different apps I've developed, but this one is failing for some weird reason. I archive my app, then attempt to Validate the archive and get the following error message:
我正在提交对我的一个应用程序的更新。我已经用我开发的许多不同的应用程序做了几十次,但由于某种奇怪的原因,这个失败了。我存档我的应用程序,然后尝试验证存档并收到以下错误消息:
This bundle is invalid. The key CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version.
此捆绑包无效。Info.plist 文件中的密钥 CFBundleVersion 必须包含比之前上传的版本更高的版本。
iTunesConnect shows this app is currently at 1.0 and I've configured it to be ready to upload version 1.1 (screenshot with app icons redacted):
iTunesConnect 显示此应用程序当前为 1.0,我已将其配置为准备上传 1.1 版(应用程序图标已编辑的屏幕截图):
Here's a screenshot of my app target's summary info which shows the version and short version are both "1.1":
这是我的应用程序目标摘要信息的屏幕截图,其中显示版本和简短版本均为“1.1”:
Here is the top half of the Info.plist from the Bundle Archive:
这是来自 Bundle Archive 的 Info.plist 的上半部分:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppStoreFileSize</key>
<integer>20859080</integer>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>Applications/MyApp.app</string>
<key>CFBundleIdentifier</key>
<string>com.mydomain.myapp</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
And here's the relevant piece of Info.plist from within the app within the Archive bundle:
这是存档包内应用程序中的相关 Info.plist 片段:
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1.1</string>
All version numbers within my updated app say 1.1, iTunesConnect says it's expecting 1.1... but it's complaining that the number is wrong.
我更新的应用程序中的所有版本号都说 1.1,iTunesConnect 说它期待 1.1……但它抱怨这个数字是错误的。
What am I missing?
我错过了什么?
回答by Michael Wilson
FYI. Apple thinks 1.11 > 1.2, so if you are going from 1.11 to 1.2 you need to go all the way to 1.20.
供参考。Apple 认为 1.11 > 1.2,所以如果你从 1.11 到 1.2,你需要一直到 1.20。
Enjoy.
享受。
回答by Kenny Wyland
It turns out that I had some problem in my original submission which caused the user-visible version to be "1.0" but the internal bundle version to be "1.2". So I changed my new version to be 1.3 and 1.3 and the submission worked.
原来我在原始提交中遇到了一些问题,导致用户可见版本为“1.0”,但内部捆绑版本为“1.2”。所以我把我的新版本改成了 1.3 和 1.3,提交成功了。
回答by John MacAdam
Same thing happened to me. My current App Store version was 2.03. I attempted to upload 2.1. All I had to do was change it to 2.10and it worked.
同样的事情发生在我身上。我当前的 App Store 版本是2.03。我试图上传2.1。我所要做的就是将其更改为2.10并且它起作用了。
回答by Ammar Mujeeb
Increasing the CFBundleShortVersionString or "Bundle versions string, short" did the Job for me.
增加 CFBundleShortVersionString 或“Bundle versions string, short”为我完成了这项工作。
回答by Ser Pounce
Here is how I fixed the problem (and I'm guessing this is the issue with a lot of people):
这是我解决问题的方法(我猜这是很多人的问题):
1) Click on the general tab of your projects settings (which can be accessed by clicking on your project name which is at the top of all the code files).
1) 单击项目设置的常规选项卡(可以通过单击位于所有代码文件顶部的项目名称访问)。
2) Make sure the build field matches what you put in your plist for the "Bundle Version" key.
2)确保构建字段与您在 plist 中为“捆绑版本”键放置的内容匹配。
This was the problem for me, for whatever reason they were out of sync. I think when you change Bundler Version key it's supposed to sync up (and vice versa). But it didn't happen for whatever reason - might be a bug.
这对我来说是个问题,无论出于何种原因,它们都不同步。我认为当您更改 Bundler Version 密钥时,它应该同步(反之亦然)。但无论出于何种原因它都没有发生 - 可能是一个错误。
回答by jungledev
This can be caused for another reason entirely.
这可能完全由另一个原因引起。
I had an active TestFlight beta running. Build 2020, version 407
我有一个活跃的 TestFlight 测试版正在运行。 构建 2020版本 407
I submitted an app for officialApp Store review. Build 2020, version 435, and it was approved. It is just sitting there, waiting for me to push it live into the App Store.
我提交了一个应用程序进行官方App Store 审核。 Build 2020版本 435,已获批。它只是坐在那里,等着我把它实时推送到 App Store 中。
Without adding a complicated side story, what I wanted to do is to give my TestFlight beta users an updated version to preview the official App Store version for a few days, before making the App Store version live. Why, you ask? Because they were getting free features, there were about to cost money once the app would go live.
在不添加复杂的支线故事的情况下,我想做的是给我的 TestFlight 测试版用户一个更新版本,以便在 App Store 版本上线之前预览官方 App Store 版本几天。你为什么问?因为他们正在获得免费功能,所以一旦应用程序上线,他们就要花钱。
So, I submitted Build 2020, version 436, to TestFlight, and it was rejected.
因此,我向TestFlight提交了Build 2020版本 436,但被拒绝了。
It was rejected because I have an approved official App-Store candidate with the same build number
它被拒绝了,因为我有一个具有相同内部版本号的已批准的官方 App-Store 候选
Solution: Change the build number of your TestFlight version. I submitted Build 20200(I added an extra zero) version 436 to TestFlight, and it was approved. Don't worry, you can still push this build to the same TestFlight beta group, as long as you're still using the same BundleID.
解决方案:更改您的 TestFlight 版本的内部版本号。我向TestFlight提交了Build 20200(我添加了一个额外的零)版本 436,并获得了批准。不用担心,只要您仍在使用相同的 BundleID,您仍然可以将此构建推送到同一个 TestFlight 测试版组。
回答by swift2geek
One of the reason could be next situation: You sent to AppStore version 1.0 with build number 50. You decided to give it to TestFlight users for test. And simultaneously decided to send this version for review to AppStore. Users starts testing it and all fine. Some time later AppStore approves it, and its not releases( it has developer peinding status). After u made some changes and want to give your Testflight users new release. You decide to increase build number to 51 and keep version number at 1.0. You will get that error which you described in your question in this case. You have to increase App version too.
原因之一可能是下一种情况:您将版本号为 50 的 AppStore 1.0 版发送到 AppStore。您决定将其提供给 TestFlight 用户进行测试。并同时决定将此版本发送到 AppStore 进行审核。用户开始测试它,一切正常。一段时间后,AppStore 批准了它,但它没有发布(它具有开发人员等待状态)。在您进行了一些更改并希望为您的 Testflight 用户提供新版本之后。您决定将内部版本号增加到 51,并将版本号保持在 1.0。在这种情况下,您将收到您在问题中描述的错误。您也必须增加应用程序版本。
回答by Sebastian Paduano
My problem was that I tried from 1.9.12 to 1.9.2... if you think about it 1.9.2 its actually 1.9.02, so if you set 1.9.20that would solve the problem.
我的问题是我尝试从 1.9.12 到 1.9.2...如果你考虑一下 1.9.2 它实际上是 1.9.02,所以如果你设置1.9.20可以解决问题。
回答by Ghulam Rasool
If above answers don't fix your problem, Please make sure that the version in Xcode must be same to the version that you have created in Itunes connect.
如果以上答案不能解决您的问题,请确保 Xcode 中的版本必须与您在 Itunes connect 中创建的版本相同。
In my case, on itunes connect, version was 1.38 but version was 1.3.8 in Xcode. Once I changed version to 1.38 in Xcode, issue was resolved.
就我而言,在 iTunes Connect 上,版本是 1.38,但在 Xcode 中版本是 1.3.8。一旦我在 Xcode 中将版本更改为 1.38,问题就解决了。