EAS build: The application's Info.plist does not contain a valid CFBundleShortVersionString

Unable to run the application which is built for iOS Simulator.
I got this error:

Installing your app on the simulator...
    Error: Some other error occurred while running xcrun command.
      xcrun exited with non-zero code: 22
    An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
    Failed to install the requested application
    The application's Info.plist does not contain a valid CFBundleShortVersionString.
    Ensure your bundle contains a valid CFBundleShortVersionString.

Tried eas prebuild, didn’t help.

My eas.json

{
  "cli": {
    "version": ">= 3.1.1"
  },
  "build": {
    "development-simulator": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true,
        "resourceClass": "m1-medium"
      }
    },
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "preview": {
      "distribution": "internal",
      "ios": {
        "resourceClass": "m1-medium"
      }
    },
    "production": {
      "ios": {
        "resourceClass": "m1-medium"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

app.json (truncated)

{
  "expo": {
    "jsEngine": "hermes",
    "owner": "volkish",
    "name": "###############",
    "slug": "###############",
    "privacy": "public",
    "platforms": [
      "iOS",
      "android"
    ],
    "scheme": "###############",
    "primaryColor": "#FF786E",
    "version": "1.9",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0,
      "url": "https://u.expo.dev/344eef40-e5f4-11e9-8502-f3e28748921d"
    },
    "assetBundlePatterns": [
      "assets/animations/**/*",
      "assets/pregnancyAssets/**/*",
      "assets/*"
    ],
    "userInterfaceStyle": "light",
    "ios": {
      "appStoreUrl": "###############",
      "buildNumber": "1.9.2",
      "usesAppleSignIn": true,
      "bundleIdentifier": "##############",
      "supportsTablet": false,
      "infoPlist": {
        "CFBundleAllowMixedLocalizations": true,
        "UIUserInterfaceStyle": "Light",
        "NSPhotoLibraryUsageDescription": "Allow the application to access the photo library to upload your avatar and create messages with photos.",
        "NSUserTrackingUsageDescription": "This identifier will be used to deliver personalized ads to you."
      }
    },
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ],
      [
        "expo-media-library",
        {
          "photosPermission": "Allow the application to access the photo library to upload your avatar and create messages with photos.",
          "isAccessMediaLocationEnabled": true
        }
      ],
      [
        "expo-tracking-transparency",
        {
          "userTrackingPermission": "This identifier will be used to deliver personalized ads to you."
        }
      ],
      "@react-native-firebase/app",
      "expo-notifications",
      "sentry-expo",
      "expo-tracking-transparency"
    ],
    "runtimeVersion": {
      "policy": "appVersion"
    }
  }
}

Error states that value in Info.plist is incorrect, so show the content of that file. You have a bare project, so most of the app.json values do not do anything.

<?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>CFBundleAllowMixedLocalizations</key>
    <true/>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>Momsline</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
    <key>CFBundleShortVersionString</key>
    <string>1.9</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>momsline</string>
          <string>##########</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>com.googleusercontent.apps.352739708501-l02sdtg6gmo4loreb8vpc7kppdgplkdq</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>exp+##########</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>##########</string>
        </array>
      </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>1.9.2</string>
    <key>FacebookAppID</key>
    <string>##########</string>
    <key>FacebookDisplayName</key>
    <string>##########</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>fbapi</string>
      <string>fb-messenger-api</string>
      <string>fbauth2</string>
      <string>fbshareextension</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>NSAppTransportSecurity</key>
    <dict>
      <key>NSAllowsArbitraryLoads</key>
      <true/>
      <key>NSExceptionDomains</key>
      <dict>
        <key>localhost</key>
        <dict>
          <key>NSExceptionAllowsInsecureHTTPLoads</key>
          <true/>
        </dict>
      </dict>
    </dict>
    <key>NSCameraUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to access your camera</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to access your microphone</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>Allow $(PRODUCT_NAME) to save photos</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Allow the application to access the photo library to upload your avatar and create messages with photos.</string>
    <key>NSUserTrackingUsageDescription</key>
    <string>This identifier will be used to deliver personalized ads to you.</string>
    <key>SKAdNetworkItems</key>
    <array>
      <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>v9wttpbfk9.skadnetwork</string>
      </dict>
      <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>n38lu8286q.skadnetwork</string>
      </dict>
    </array>
    <key>UILaunchStoryboardName</key>
    <string>SplashScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
      <string>armv7</string>
    </array>
    <key>UIRequiresFullScreen</key>
    <false/>
    <key>UIStatusBarStyle</key>
    <string>UIStatusBarStyleDefault</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIUserInterfaceStyle</key>
    <string>Light</string>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
  </dict>
</plist>

It’s not a bare project. What happened:

  1. I did “npx expo prebuild”
  2. Played with that in Xcode
  3. Run eas build
  4. Reverted to prev state
  5. Now I can’t run what expo serves built

Here is Info.plist generated by eas prebuilt

https://pastebin.com/HUt9xnYx

In other words, I unable to run the app even when ios folder doesn’t exist

The required format is three period-separated integers, such as 10.14.1

1.9 is not a valid version

Oh, what a stupid mistake, Thank you ! I will change that and try to build it again

Set

expo.version = 1.9.0
expo.ios.buildNumber = 1.9.2

Screenshot from https://expo.dev/accounts/volkish/projects/.../builds

Same error

Installing your app on the simulator...
    Error: Some other error occurred while running xcrun command.
      xcrun exited with non-zero code: 22
    An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
    Failed to install the requested application
    The application's Info.plist does not contain a valid CFBundleShortVersionString.
    Ensure your bundle contains a valid CFBundleShortVersionString.

This turns the app into a bare project. So at the time that you built the app, it was a bare project.

It looks like you did not rebuild after this point, so if the changes you made manually in Xcode caused problems then those problems wouldn’t have been fixed by just reverting your project to the previous state. You would have had to rebuild.

You mean I can’t return to a managed project after npx expo prebuild?

If I run expo prebuild again (after reverting the project) and then build in Xcode (with zero changes) I get the same error.

I noticed that there is no version on general tab:

image

And If I set it manually - it works (in Xcode). Does this mean that I need to set it manually after first expo prebuild?

Summary,

Once you did expo prebuild and then eas build there is no way to return to a managed flow. You must keep iOS folder and update a version manually.

If you prebuild, and you keep the ios directory, then you will have to make further changes using Xcode (or else use npx expo prebuild --clean to regenerate ios from scratch.)

No, that’s not right. You can revert to the managed workflow. The main thing is to delete ios and android. But see expo.fyi/prebuild-cleanup for more details.

No, that’s not right. You can revert to the managed workflow. The main thing is to delete ios and android . But see expo.fyi/prebuild-cleanup for more details.

I did all things mentioned on this page. My project was as clean as before expo prebuild. It could be a cache on expo servers which breaks building process.

What does the “Prebuild” section of the build logs look like?

e.g.:

hmmm… I wonder why it’s running yarn with the --no-immutable option.

Could you post the current ios and plugins sections from your app.json and also the dependencies and devDependencies sections from package.json?

yarn is ran with no immutable because prebuild may change version of some packages, so regular installation would fail in that case because CI=1 env is set on the worker