Xcode won't use with FLUTTER_BUILD_NAME

484

I ran into this issue yesterday and really struggled to find out what's going on my flutter project. I hope my two cents help anyone out there...

One day I manually updated version in xcode (super mistake) then Generated.xcconfig not worked anymore. I still don't know why some settings have changed also but anyway here's solution:

well-working versioning project:

xcode screenshot with no problem

project of the problem:

xcode screenshot with problem

When I changed the three Runner configuration file to Debug, Release, Release, the version showed up immediately:

enter image description here

ps) I got hint from the chat of @Zholen and @Claudio Redi. Thank you so much. I still don't know which action triggered that settings but I'm going to bed now..

Share:
484
Zholen
Author by

Zholen

Updated on December 21, 2022

Comments

  • Zholen
    Zholen over 1 year

    Xcode won't build using $(FLUTTER_BUILD_NAME) or $(FLUTTER_BUILD_NUMBER)

    Runner -> Target -> Build Settings -> Versioning

    Runner -> Target -> Build Settings -> Versioning

    Runner -> Target -> General -> Identity

    enter image description here

    Runner -> Flutter -> Generated.xcconfig

    enter image description here

    info.plist

    enter image description here

    Can anyone see what I'm doing wrong here? The Generated.xcconfig correctly has the version information from my pub spec.yaml version: 1.0.3+5

    But each time I build the version information is null.

    • Claudio Redi
      Claudio Redi almost 4 years
      Where do you see version information as null?
    • Zholen
      Zholen almost 4 years
      In app it reports it as null+null via package_info. And if I GetInfo from Finder on the build it reports a '--'. If I set the version values myself package_info reports correctly.
    • Zholen
      Zholen almost 4 years
      Also, at some point I had to add Runner -> Project -> User-Defined -> FLUTTER_ROOT to build, which would indicate that it is not puling it from Generated.xcconfig either
    • Claudio Redi
      Claudio Redi almost 4 years
      Do you have any other xcconfig file in the project? If you do... do they include Generated.xcconfig?
    • Zholen
      Zholen almost 4 years
      There is a folder called Flutter that contains Release.xcconfig, Debug.xcconfig, Generated.xcconfig, and AppFrameworkInfo.plist, all of which is generated/managed by Flutter. The 3rd screenshot is of data inside the Generated.xcconfig
    • Claudio Redi
      Claudio Redi almost 4 years
      Release.xcconfig and Debug.xcconfig include Generated.xcconfig, right?
    • Zholen
      Zholen almost 4 years
      Yes, both files #include Generated.xcconfig as the last line
  • Gary O' Donoghue
    Gary O' Donoghue about 2 years
    thanks man, worked a treat!