Search code examples
xcode8

How to set CURRENT_PROJECT_VERSION in Xcode 8


Since upgrading to Xcode 8, when I do a build with fastlane, I get the following error message:

There does not seem to be a CURRENT_PROJECT_VERSION key set for this project

If I go to Xcode > Build Settings and go down to Versioning, there is a Current Project Version key, as shown below:

screen shot of versioning

The help text says to enter an integer or floating point number, but when I click on the field, there is no opportunity to enter a number in either the Debug or Release field. This is different from the screen shot shown in this apple tech Q&A so there appears to have been a change in Xcode since the Q&A was released.


Solution

  • Currently when you get that fastlane error, terminal logs redirects you to

    Automating Version and Build Numbers Using agvtool

    to understand what you need to do.

    Summary

    1. Enable agvtool.

      Build Settings > Current Project Version > $(CURRENT_PROJECT_VERSION)

      Build Settings > Versioning System > Apple Generic enter image description here

    2. Set up your version and build numbers.

      Target > Info > Bundle versions string, short (CFBundleShortVersionString) > "your init version"

      Target > Info > Bundle version (CFBundleVersion) > "your init value" enter image description here

    That helps me a lot.