Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter version information not used by Xcode

Tags:

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?

like image 877
Magnus Avatar asked Mar 13 '19 11:03

Magnus


1 Answers

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.

like image 145
Günter Zöchbauer Avatar answered Nov 15 '22 04:11

Günter Zöchbauer