57

Xcode is build the project and when build is success, I get this message "The bundle's Info.plist does not contain a CFBundleVersion key or its value is not a string". What is that mean. There is my 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></key>
    <string></string>
    <key>Additional_Version_String</key>
    <string>Updated on build</string>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundleExecutable</key>
    <string>${EXECUTABLE_NAME}</string>
    <key>CFBundleIcons</key>
    <dict/>
    <key>CFBundleIcons~ipad</key>
    <dict/>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>${PRODUCT_NAME}</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>Commit_Short_Hash</key>
    <string>Updated on build</string>
    <key>ITSAppUsesNonExemptEncryption</key>
    <false/>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSContactsUsageDescription</key>
    <string>Vialer needs access to your contacts to make calling to your contacts possible</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Vialer needs access to your microphone to make calling possible</string>
    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
        <string>fetch</string>
        <string>remote-notification</string>
        <string>voip</string>
    </array>
    <key>UIMainStoryboardFile</key>
    <string>MainStoryboard</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UIRequiresPersistentWiFi</key>
    <true/>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleBlackTranslucent</string>
    <key>UIStatusBarTintParameters</key>
    <dict>
        <key>UINavigationBar</key>
        <dict>
            <key>Style</key>
            <string>UIBarStyleDefault</string>
            <key>Translucent</key>
            <true/>
        </dict>
    </dict>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <true/>
</dict>
</plist>
4
  • 2
    What ended up being my problem was that the GoogleService-Info (and potentially LaunchScreen) were no longer properly added to the project in Xcode. I just re-added them (right click on project folder, add file) and it built. Frustrating because the error was so unhelpful, sharing here in case it helps someone else. Jun 2, 2022 at 17:35
  • Yeah another plist file was somehow not added in the project while the error was misleading.
    – naz
    Aug 31, 2022 at 13:53
  • @SaraInésCalderón Can you help me please where to do this exactly? And which file I need to add? In xcode right click on "Runner", then "Add files to Runner", is that correct? Then which file to select? Nov 6, 2022 at 7:12
  • 1
    @lukassteiner if you look on the right-hand side of XCode when you're looking at your project's files, if you see any of those highlighted in red, right-click to delete, then re-add. Nov 6, 2022 at 20:29

17 Answers 17

98

I have the same issue with CFBuildVersion and than i found that in my project Target there is no build version inserted.

So i have just inserted build version and issue solved. enter image description here

2
  • 9
    sometimes Xcode is so dumb! fixed my problem as well, the project was fine last night, opened it again today, and got this error! thanks anyway Jun 12, 2020 at 12:02
  • no kidding @ArashAfsharpour! i noticed the error for myself when archiving an app to launch to TestFlight. Apr 12, 2022 at 17:51
17

I followed solutions from everywhere and these are the steps I ended up with that worked for me:

Solution:

  1. Open the terminal and fix any relevant issues flutter doctor displays:

flutter doctor

  1. Run flutter clean

enter image description here

  1. Delete the Podfile, Podfile.lock and the Pods directory from your ios project

enter image description here

  1. Open the Runner.xcworkspace project in Xcode

enter image description here

  1. Update the build number as @Hardik Vyas mentioned

enter image description here

  1. As @iDevOrz mentioned, Erase All Content and Settings from the simulator

enter image description here

  1. Clean, build and run the app in Xcode
1
  • 1
    I've been struggling with this issue for a long time, but this solution helped to solve all sorts of problems, not just the one above. Thanks. Feb 1, 2022 at 17:38
11

I have the same problem.

I fix it by Simulator menu -> Hardware -> Erase All Content and Setting.

Maybe it's a Simulator bug.

2
  • 2
    This didn't work for me unfortunately. Do you remember if there were any other steps you needed to take? Oct 1, 2019 at 19:18
  • @John Montgomery Sorry, Too long ago to remember.
    – iDevOrz
    Oct 11, 2019 at 6:43
11

Xcode 12.5 - It might be a bug unrelated to the plist

I have Big Sur and Xcode 12.5 (not beta) and I created a new SwiftUI project. To save time I dragged a folder containing a bunch of json files in my project navigator. The folder was named "Resources" but I hope it was not the issue.

Before dragging the folder the project compiled. After having the new folder it would not compile anymore and would give me the error as below. Oddest bug I found.

Solution, I added the files one by one and then I created the enclosing folder, then it worked. And it is reproducible! I spent 30 minutes today on this. Luckily it was at the very beginning of a project and could compare and see when it would stop compiling..

enter image description here

3
  • 3
    Same! Big Sur, Xcode 12.5.1 (12E507) a folder name 'resources' under project root. change the folder to 'data' project built
    – mushcraft
    Aug 12, 2021 at 13:40
  • OMG this issue is so weird. The error is not helpful at all. By the way I'm using Monterey and XCode 14 beta
    – atulkhatri
    Jun 17, 2022 at 5:04
  • Ridiculous...Xcode Version 15.2 (15C500b), Sonoma OS 14.2.1 - same issue. Added folder "resources" to the projects - CFBundleVersion issue, renamed folder to "sample" - no issue.... Jan 13 at 5:20
11

Just add version and build number

enter image description here

0
6

The fix for me was to add a build number to the target. Click on your target, go to General, then underneath Identity is a field for Build.

3

if you have this issue in Flutter, you can solve by:

Delete ios folder in your Flutter project then run:

flutter create .

This will regenerate again the iOS project files, then run.

flutter run
2

I have the same issue with CFBuildVersion. I noticed my Target had no build version.

So I filled in the version and build, which solved my issue.

example

2
  • 1
    This was also my case, I didn't set the version number Aug 28, 2023 at 19:12
  • In my case Missing the Build number Dec 26, 2023 at 6:14
1

You can use agvtool to fix theses error : https://developer.apple.com/library/archive/qa/qa1827/_index.html

So, to solve the CFBundleVersion issue, open terminal, go to the project root (iOS project), and type this command :

agvtool new-version -all 2.6.9

And hit enter.

1

I just added this key CFBundleVersion and copied the value from the above key as shown in the .plist (see project navigator on the left): enter image description here

1

I just edit my project's ".plist" file and added a CFBundleShortVersionString entry with some value.

1

Inside your .plist, check whether you have this key or not. Bundle version string (short)

enter image description here

1

In my case info.plist, i have changed values of Bundle version string (short) and Bundle version to some user defined values.

Example as below:

Bundle version string (short) : $(APP_VERSION)
Bundle version : $(BUILD_NO)

$(APP_VERSION) and $(BUILD_NO) are no where defined

So i changed them to default values as below

Screenshot

And it worked fine.

0

Just Insert the build version to your project

0

add to info.plist in code mode worked for me

<plist version="1.0">
<string>1.0</string>
</plist>
0

In my case, my info.plist got formatted by an xml formatter in VSCODE. The formatted xml document is a valid xml document, but somehow, Xcode does not accept it.

Eg of formatted xml :

<key>
     CFBundleDisplayName
</key>
<string>
     MyApp
</string>

But the xml that Xcode accepts :

<key>CFBundleDisplayName</key>
<string>MyApp</string>
-1

For me, it was crashing because of a missing SDK which was linked properly but I forgot to embed it in the application. The app should normally crash with dyld: not loaded ... but instead, it showed this totally unrelated Info.plist issue. 🤯

That said, I would say it is a bug on the Apple's side and pretty much everything that prevents the app from starting can produce this error.

Xcode 14.2, native M1 mode.

I hope it helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.