JerryZhou
JerryZhou

Reputation: 5176

User-Defined Value `FLUTTER_BUILD_NAME` & `FLUTTER_BUILD_NUMBER` not inherit from Project Setting

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 ?

Upvotes: 9

Views: 10153

Answers (2)

Harith AL Any
Harith AL Any

Reputation: 293

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

Upvotes: 15

JerryZhou
JerryZhou

Reputation: 5176

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.

Upvotes: 12

Related Questions