50

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>
bilaldogan
  • 663
  • 1
  • 5
  • 13
  • 1
    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. – Sara Inés Calderón Jun 02 '22 at 17:35
  • Yeah another plist file was somehow not added in the project while the error was misleading. – naz Aug 31 '22 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? – lukassteiner Nov 06 '22 at 07: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. – Sara Inés Calderón Nov 06 '22 at 20:29

16 Answers16

92

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

Hardik Vyas
  • 1,973
  • 1
  • 20
  • 43
  • 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 – Arash Afsharpour Jun 12 '20 at 12:02
  • no kidding @ArashAfsharpour! i noticed the error for myself when archiving an app to launch to TestFlight. – Ars_Codicis Apr 12 '22 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
ArtiomLK
  • 2,120
  • 20
  • 24
  • 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. – Steve Ben-Ari Feb 01 '22 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.

iDevOrz
  • 730
  • 8
  • 16
11

Just add version and build number

enter image description here

Abir Ahsan
  • 2,649
  • 29
  • 51
9

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

multitudes
  • 2,898
  • 2
  • 22
  • 29
  • 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 '21 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 '22 at 05:04
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.

flexaargo
  • 61
  • 1
  • 2
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.

ibrahim dao
  • 56
  • 1
  • 4
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

arielhasidim
  • 694
  • 10
  • 19
1

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

James Risner
  • 5,451
  • 11
  • 25
  • 47
D.A.C. Nupun
  • 495
  • 5
  • 8
1

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
Mina Farid
  • 5,041
  • 4
  • 39
  • 46
0

Just Insert the build version to your project

TheEhsanSarshar
  • 2,677
  • 22
  • 41
0

add to info.plist in code mode worked for me

<plist version="1.0">
<string>1.0</string>
</plist>
Logic
  • 705
  • 1
  • 9
  • 27
0

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

Ricardo Barroso
  • 634
  • 9
  • 11
0

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

enter image description here

Simran Singh
  • 445
  • 6
  • 8
0

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.

Cyril Cermak
  • 191
  • 2
  • 4
0

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.

Arshad Shaik
  • 1,095
  • 12
  • 18