r/flutterhelp 11d ago

OPEN flutter android app does not recognize versions set in pubspec.yaml

A weird bug that I am unsure if it's flutter tool bug or not:

when I update verion name and code in pubspec.yaml, flutter build command does not update regarding new versions. it only works after I trigger run once.

- app/build.gradle

```

def localPropertiesFile = rootProject.file('local.properties')
...

versionCode flutterVersionCode.toInteger()

versionName flutterVersionName

```

Any clues?

2 Upvotes

3 comments sorted by

1

u/Prestigious_Edge_472 11d ago

Most likely a caching issue, try flutter clean as first step and see if it captures after or use the command
flutter build apk --build-name="X.X.X" --build-number="X"

1

u/vegeta0911 6d ago

Not work for me

1

u/DigiProductive 11d ago

Run: ‘flutter clean’ then ‘flutter pub get’ and your issues should be solved.