Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode won't use with FLUTTER_BUILD_NAME

Tags:

xcode

flutter

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.

like image 375
Zholen Avatar asked Sep 08 '26 21:09

Zholen


2 Answers

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..

like image 187
Roeniss Avatar answered Sep 11 '26 13:09

Roeniss


If you want to change the version of your app, just change in pubspec.yml

like version: 1.0.4+3

Then run

“flutter run”

--- or ---

"fvm flutter run" if you are managing your flutter version using fvm

This will regenerate ios/Flutter/Generated.xcconfig and the same referred in Info.ptlist file

FLUTTER_BUILD_NAME=1.0.4

FLUTTER_BUILD_NUMBER=3

Make sure the version details not hard-coded in the file ios/Runner.xcodeproj/project.pbxproj. If it is hardcoded , you can simply remove or comment it out.

like image 40
Kannan M N Avatar answered Sep 11 '26 15:09

Kannan M N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!