6

Usually, User-Defined Value would inherited from Project setting as xcode-how-to-have-target-settings-inherit-from-project,

But I found that the FLUTTER_BUILD_NAME & FLUTTER_BUILD_NUMBER not the case. Their value in Project & Target are independent.

Is there some config I should change to apply them to be inherited ?

JerryZhou
  • 4,566
  • 3
  • 37
  • 60

2 Answers2

11

Just change the version in pubspec.yaml and then in terminal flutter build ios and go to Xcode you will see the new version in build setting

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
Harith AL Any
  • 243
  • 3
  • 16
7

Basically it's because I miss the part of version: 1.0.0+1 in file pubspec.yaml.

It's format is: "version: FLUTTER_BUILD_NAME+FLUTTER_BUILD_NUMBER"

  1. Flutter will build a file /ios/Flutter/Generated.xcconfig with FLUTTER_BUILD_NAME & FLUTTER_BUILD_NUMBER base on pubspec.yaml.
  2. Xcode will inherit the value in target setting & project setting from this .xcconfig;

So just update the version in pubspec.yaml, don't update it in Project Setting or Target Setting to avoid value overwrite.

JerryZhou
  • 4,566
  • 3
  • 37
  • 60