Magnus
Magnus

Reputation: 18728

Flutter version information not used by Xcode

In my iOS project, I have the following settings in the Runner -> General tab, under the Identity section:

Version: $(FLUTTER_BUILD_NAME)
Build:   $(FLUTTER_BUILD_NUMBER)

which is the same as when creating a brand new Flutter project. However, when I was going to create an Archive for releasing my app, Xcode complained that those fields were missing or incorrect (I don't remember the exact error message).

The only way I could build the release app was to change them to hardcoded strings - i.e. 1.0.0 and 1 respectively. What could be causing this issue? It would be a nuisance to have to remember to update those for every release, and I shouldn't have to, right?

Upvotes: 6

Views: 1602

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657048

If you created this project with an older Flutter version
several files created in the ios/ and android/ sub-directories might be outdated.

Newer Flutter versions might generate these files a bit differently and projects created with older Flutter versions might cause issues.

Ways to fix

Delete the ios/ and android/ directories and run flutter create . to re-generate these directories.

HINT Custom changes will be lost and need to be re-applied. This is easiest if the project is committed to a version control system like Git.

Upvotes: 5

Related Questions