The bundle's Info.plist does not contain a CFBundleVersion key or its value is not a string
Asked Answered
M

17

58

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>
Monroe answered 30/3, 2017 at 7:42 Comment(4)
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.Gaslit
Yeah another plist file was somehow not added in the project while the error was misleading.Thorax
@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?Bamby
@Bamby 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.Gaslit
R
101

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

Ronna answered 26/12, 2019 at 6:15 Comment(2)
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 anywayDigitalis
no kidding @ArashAfsharpour! i noticed the error for myself when archiving an app to launch to TestFlight.Tomchay
E
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
Ejecta answered 19/1, 2020 at 2:7 Comment(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.Barbicel
S
11

I have the same problem.

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

Maybe it's a Simulator bug.

Saunderson answered 13/6, 2019 at 7:33 Comment(2)
This didn't work for me unfortunately. Do you remember if there were any other steps you needed to take?Cynara
@John Montgomery Sorry, Too long ago to remember.Saunderson
T
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

Toomay answered 2/5, 2021 at 13:32 Comment(3)
Same! Big Sur, Xcode 12.5.1 (12E507) a folder name 'resources' under project root. change the folder to 'data' project builtTidbit
OMG this issue is so weird. The error is not helpful at all. By the way I'm using Monterey and XCode 14 betaTerrance
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....Importune
C
11

Just add version and build number

enter image description here

Canaletto answered 28/5, 2021 at 6:17 Comment(0)
C
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.

Chloroprene answered 7/10, 2019 at 18:23 Comment(0)
T
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
Tarn answered 22/4, 2023 at 1:40 Comment(0)
E
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

Elevation answered 25/10, 2022 at 10:53 Comment(2)
This was also my case, I didn't set the version numberPhenobarbitone
In my case Missing the Build numberSixgun
V
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.

Vaughan answered 2/11, 2021 at 14:7 Comment(0)
C
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

Countersubject answered 12/12, 2021 at 21:38 Comment(0)
C
1

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

Coprophagous answered 9/2, 2022 at 22:17 Comment(0)
H
1

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

enter image description here

Hochstetler answered 24/5, 2022 at 7:18 Comment(0)
V
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.

Venola answered 31/3, 2023 at 5:1 Comment(0)
G
0

Just Insert the build version to your project

Glossematics answered 10/4, 2020 at 15:8 Comment(0)
M
0

add to info.plist in code mode worked for me

<plist version="1.0">
<string>1.0</string>
</plist>
Mendelian answered 12/8, 2021 at 8:38 Comment(0)
E
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>
Emmittemmons answered 24/3 at 7:27 Comment(0)
B
-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.

Buddhi answered 8/2, 2023 at 17:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.