6

When submitting my app to the app store I get this error:

enter image description here

Here is the relevant part from my info.plist file:

    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1.0.0</string>

enter image description here

When I submit the app you can clearly see that there is no version 1.0.0.pre.

enter image description here

I use CocoaPods as well.

How do I solve this problem?

Update: Here is what I try on my project path: find . -name "*.plist" -exec grep -o -A 1 "CFBundleShortVersionString" {} \; and here is the result:

CFBundleShortVersionString
    <string>1.0.6</string>
CFBundleShortVersionString
    <string>1.0</string>
CFBundleShortVersionString
    <string>3.3.4</string>
CFBundleShortVersionString
    <string>1.5.5</string>
CFBundleShortVersionString
  <string>2.0.2</string>
CFBundleShortVersionString
  <string>0.7.0</string>
CFBundleShortVersionString
  <string>0.0.9</string>
CFBundleShortVersionString
  <string>1.2.2</string>
CFBundleShortVersionString
  <string>1.6.0</string>
CFBundleShortVersionString
  <string>1.7.2</string>
CFBundleShortVersionString
  <string>2.0.0</string>
CFBundleShortVersionString
  <string>1.3.2</string>
CFBundleShortVersionString
  <string>1.4.1</string>
CFBundleShortVersionString
  <string>1.0</string>
CFBundleShortVersionString
  <string>0.9.1</string>
CFBundleShortVersionString
  <string>0.2.3</string>
CFBundleShortVersionString
  <string>1.0.0</string>
CFBundleShortVersionString
  <string>3.7.3</string>
CFBundleShortVersionString
  <string>0.15.0</string>
CFBundleShortVersionString
  <string>1.0.0.pre</string>
CFBundleShortVersionString
  <string>2.3.0</string>
CFBundleShortVersionString
  <string>2.0.0</string>
CFBundleShortVersionString
  <string>1.2</string>
CFBundleShortVersionString
  <string>3.0.2</string>

Update 2: Doing: xcodebuild > build.log I get the following error:

2015-10-25 22:02:52.653 xcodebuild[6273:1043943] [MT] PluginLoading: Required plug-in compatibility UUID 7265231C-39B4-402C-89E1-16167C4CC990 for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/VVDocumenter-Xcode.xcplugin' not present in DVTPlugInCompatibilityUUIDs
** BUILD FAILED **
Michael
  • 32,527
  • 49
  • 210
  • 370
  • Search for .pre in the plist file and make sure it's not there. If it's not there, clean the project and the build folder and then submit again – Lefteris Oct 22 '15 at 17:32
  • 1
    ha ha ha don't you think I did this? – Michael Oct 22 '15 at 17:34
  • Restart Xcode and try again ? Also did you check what Xcode has for ShortVersionString ? – Lefteris Oct 22 '15 at 17:35
  • Check your build configurations and make sure they have the same version strings. Also double check your not using XCode Beta's tools. – Tobias Oct 22 '15 at 18:11
  • I do use the final release of Xcode 7. It worked before when I uploaded version 1.0.0 and 1.0.5 but now for whatever reason it does not work anymore. – Michael Oct 22 '15 at 20:32
  • @Tobias which variables should I check in Build Settings? – Michael Oct 23 '15 at 05:43
  • Do you have any embedded applications? Don't you have a different Info.plist set for your distribution build? – Sulthan Oct 25 '15 at 12:55
  • I only use cocoa pods. – Michael Oct 25 '15 at 13:12
  • 2
    Check any third party bundles, libraries or frameworks `*.plist` that your app uses; often this is where the incorrect version is causing the issue. (eg. `find . -name "*.plist" -exec grep -o -A 1 "CFBundleShortVersionString" {} \;`) – l'L'l Oct 25 '15 at 19:10
  • Please see my edit! Still could not find the problem. – Michael Oct 25 '15 at 19:25
  • 1
    @confile I can see the `1.0.0.pre` there. – Sulthan Oct 25 '15 at 21:02
  • Right but who overrides this and why? – Michael Oct 25 '15 at 21:04
  • @confile The value is in some `*.plist` file. Find the file and check to what library/framework it belongs. That find out how you are using that library. If it's getting embedded into your app, just stop using it or downgrade/update it to a different (non-prerelease) version. – Sulthan Oct 25 '15 at 22:19
  • @confile, l'L'l's suggestion looks like it located it! Don't know how you can say it didn't find the problem?!? The string is clearly visible in the results returned for your project or workspace. – Joe Habadas Oct 26 '15 at 06:10

5 Answers5

8

Locating Version Numbers

Since you don't see the string within your project it's likely there is a bundle, frameworks or libraries associated with your project that is responsible. From the topmost directory in your project you can use find in addition to grep to look for the culprit:

find . -name "*.plist" -exec grep -iq "CFBundleShortVersionString" {} \; \
-exec grep -Him 1 "1.0.0.pre" {} \;

This may return results that might resemble something such as:

Binary file ./FooProject/Foo.framework/Info.plist matches
./FooProject/Resources/Info.plist-  <string>1.0.0.pre</string>

In the event results are returned then you'll have located the reason for the "ERROR ITMS-90096 This bundle is invalid. The value for key CFBundleVersionShortString...". If the result returned is within a Framework as shown in the first result above (eg. Binary file) or another bundle/library then you will need to change the value within it's defined project (provided that it's simply a mistake in the version number). You could also create a clean up script to replace the value at build time before code signing.

1.0.0.pre

The more important thing here though is why your app was rejected and what the 1.0.0.pre version was created specifically to do. Using a version tag that purposefully makes your app get rejected was meant to prevent you from using prerelease code in a production app — it's by design. The person(s) who created that specific pod, bundle, framework, library, are telling you:

"Don't use this prerelease code in an app that you are planning to deploy to the public".

I would suggest not just simply changing the version number of the items .plist so that your app submits successfully — instead check for a stable release version meant for production.

Multiple Info.plists

Frameworks, pods, and bundles all have their own .plist and version numbers. They are not "overriding" your main applications version number but rather simply have their own (one of which obviously not valid).

l'L'l
  • 44,951
  • 10
  • 95
  • 146
  • 1
    Thank you for this elegant solution. This was the easiest way to find out which framework Xcode error was referring to. Apple has to hide everything from us, so we can become better by doing research on its error messages. – zirinisp May 03 '17 at 22:56
5

Check 1:

You may want to search for "version" in the build settings. In case of weird situations I usually use this "view":

  1. Go to the Build Settings.
  2. On the left hand side from "Basic All" select "All"
  3. On the left hand side from "Combined Level" select "Level"
  4. In the search box type "version" and press return/enter

In my MacOSX test project it looks like this:

Version settings

Note that there is an entry named "version name suffix". I'm not sure, whether or not this exists in an iOS project (will test later). In any case you can look through the settings which "easily" relate to "version".

Check 2:

Alternatively you could grep the project file:

grep pre MyProject.xcodeproj/project.pbxproj

Check 3:

Open a terminal and in the project directory call this:

xcodebuild clean
xcodebuild > build.log

with cocoapods likely this:

xcodebuild -workspace PRJ.xcworkspace -scheme PRJ clean
xcodebuild -workspace PRJ.xcworkspace -scheme PRJ > build.log

In build.log search for "ProcessInfoPlistFile". In my case it looks like this: (manually wrapped - actual project name changed)

ProcessInfoPlistFile build/Release-iphoneos/PRJ.app/Info.plist PRJ/Info.plist
    cd /Users/fsc/prj/PRJ
    export PATH="/Applications/Xcode.app/..."
    builtin-infoPlistUtility /Users/fsc/prj/PRJ/PRJ/Info.plist 
-genpkginfo /Users/fsc/prj/PRJ/build/Release-iphoneos/PRJ.app/PkgInfo 
-expandbuildsettings -format binary -platform iphoneos 
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/Main-SBPartialInfo.plist 
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/LaunchScreen-PartialInfo.plist 
-additionalcontentfile /Users/fsc/prj/PRJ/build/PRJ.build/Release-iphoneos/PRJ.build/assetcatalog_generated_info.plist 
-o /Users/fsc/prj/PRJ/build/Release-iphoneos/PRJ.app/Info.plist

Note the -additionalcontentfile. Please check which additional files are listed and check these.

Check 4:

Look into the IPA archive to see where the "1.0.0.pre" actually is found. For that open "Window > Organizer", select your app and press "Export...". Select "Save for iOS App Store Deployment". The result will be an .ipa file. Rename it to PRJ.ipa.zip - then you can unpack it. Look for the .plist files and check their content.

Rainer Schwarze
  • 4,725
  • 1
  • 27
  • 49
0

One of your 3rd party pod has the version number "1.0.0.pre". Seems the error relates to it. The error doesnt say which plist, perhaps your build has more than one. Eg the pod in question creates a bundle on its own for instance.

Helge Becker
  • 3,219
  • 1
  • 20
  • 33
0

It is most likely a CocoaPods related problem, do not change the info.plist's in your frameworks manually, do these steps:

1) Add this script at the end of your Podfile.

post_install do |installer|
    app_plist = "MyApp/Info.plist"
    plist_buddy = "/usr/libexec/PlistBuddy"

    version = `#{plist_buddy} -c "Print CFBundleShortVersionString" #{app_plist}`
    version = `echo "#{version}" | tr -d '\n'`

    puts "Updating CocoaPods frameworks' version numbers to #{version}"

    installer.pods_project.targets.each do |target|  
        `#{plist_buddy} -c "Set CFBundleShortVersionString #{version}" "Pods/Target Support Files/#{target}/Info.plist"`  
    end  
end

2) Update the path in app_plist variable so that it matches the path to your app's .plist file.

3) Run pod install afterwards.

This script changes all Cocoapods frameworks' version numbers to match the app's plist, which is required as of 21 Oct 2015.

Esqarrouth
  • 38,543
  • 21
  • 161
  • 168
0

Pod reinstall worked for me. you can try it once.

Vikram
  • 1
  • 1