version code not changing of APK or Android App Bundle in the flutter. Even after changing it from pubspec.yaml

601

Try adding --build-name=1.0.0 --build-number=1 when you're building your apk.

For example: flutter build apk --split-per-abi --build-name=1.0.0 --build-number=1

Share:
601
DIVYANSHU SAHU
Author by

DIVYANSHU SAHU

I'm a Freelance Flutter Developer.

Updated on December 26, 2022

Comments

  • DIVYANSHU SAHU
    DIVYANSHU SAHU over 1 year

    Version Code not changing

    In my appBundle version code is not changing even after changing the code in pubspec.yaml

    version: 1.0.0+4
    

    But its showing the same error while uploading the app in the google playstore.

    Playstore Error

    What to do now. I can change the version code from the android file in the build.gradle->.

    defaultConfig {
        ...
        ....
        versionCode 4
        versionName flutterVersionName
        ....
    }
    

    But I want to change it from the pubspec.yaml.

    • Harsha pulikollu
      Harsha pulikollu over 3 years
      Try flutter clean command, before you build appbundle.
    • ॐ Rakesh Kumar
      ॐ Rakesh Kumar over 3 years
      @DIVYANSHUSAHU, on android module android>local.properties update the version code and name too will fix the problem
    • DIVYANSHU SAHU
      DIVYANSHU SAHU over 3 years
      @ॐRakeshKumar i have written that in my question that I know that method.
    • ॐ Rakesh Kumar
      ॐ Rakesh Kumar over 3 years
      @DIVYANSHUSAHU, where have you written?(In your question)
    • DIVYANSHU SAHU
      DIVYANSHU SAHU over 3 years
      android>local.properties means change the version code in local.properties Right. But I have already done changes in the defaultConfig where it takes versioncode from the local.properties.
  • DIVYANSHU SAHU
    DIVYANSHU SAHU over 3 years
    Still not working. It still builds the previous version only.