question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change versionCode/versionName when running with --release

See original GitHub issue

Hi,

I’ve been building-beta releasing-building-beta releasing an Android app for a couple of days now. Pretty much every time I build it I forget to update the versionCode and versionName in the AndroidManifest.xml. I get reminded of this then Google’s Developer Console rejects my APK because of the versionCode not being larger than the previous version.

An easy way to make a little bit easier for the developers would be to add a prompt for versionCode/versionName in the CLI if the build is run with the --release flag. And let the predefined value be read from the current AndroidManifest.xml. This way the developer will be reminded to update the versionCode/versionName and if s/he doesn’t want to it’s just an enter stroke away.

If versionCode/versionName is changed then write it back to the AndroidManifest.xml

As tns build could be a part of a larger build script where user input is not possible, a new flag, such as --auto or --quiet, should probably be added as well - skipping the prompt.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:24 (9 by maintainers)

github_iconTop GitHub Comments

16reactions
toddanglincommented, Jun 24, 2016

Revisiting this…

Since NativeScript is really created for the JS dev (versus the “native developers”), I think it feels more intuitive to control these basic app configuration values in the package.json. As Steve said, I like the option of setting the value in one place to manage all of my target platforms (could be more than iOS/Android in the future).

Steve’s proposal for version numbers in package.json is great.

If we want to reduce confusion, we could change the default value in Info.plist/AndroidManifest.xml to a clear variable placeholder (like ${app_version}) that gets replaced at build time.

If someone REMOVES this variable from the native config files, then they can set the values directly and package.json will NOT be used to change version numbers.

Thoughts?

9reactions
yahyaKacemcommented, Apr 1, 2019

Any updates here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version your app - Android Developers
Typically, you release the first version of your app with versionCode set to 1, then monotonically increase the value with each release, ...
Read more >
How to change Android version and code version number?
Choose 'app' in middle panel. Choose 'Default Config' tab in the right panel. Scroll down to see and edit 'Version Code' and 'Version...
Read more >
How to Change Version Code and Version Name in Flutter
In this post, we are going to show you how to change the version code and version name of your Flutter app. Version...
Read more >
Change Android versionCode and versionName - Integrations
Provide a versionCode in the New versionCode input to track app versions. If you leave this input empty, you will release your app...
Read more >
App version management - Expo Documentation
version · on iOS represents CFBundleShortVersionString in Info.plist. ; version · on Android represents versionName in android/app/build.gradle. ; ios.buildNumber ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found