-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
Describe the problem
📌 Feature Request: Add auto_increment_version_code
option for Android builds
📝 Problem
Currently, versionCode
for Android is written into tauri.properties
during the build process:
- If
bundle.android.version_code
is set intauri.conf.json
, it is always used. - Otherwise, Tauri derives
versionCode
deterministically from the semver version (major*1000000 + minor*1000 + patch
).
This approach has two main issues:
- Google Play requires a strictly increasing integer for
versionCode
. Repeated builds of the same app version produce the same code, which will be rejected. - Developers must manually bump
bundle.android.version_code
for every release, which is inconvenient for some cases.
Describe the solution you'd like
💡 Proposed Solution
Introduce a new config option under bundle.android
:
false
(default): keep current behavior (manual or semver-derived).true
: automatically incrementversionCode
on each build by:- reading the previous value from
tauri.properties
, - incrementing it by
+1
, - writing it back for the next build.
- reading the previous value from
✅ Behavior Summary
Config setting | Result |
---|---|
bundle.android.versionCode = 123 |
Always 123 (explicit override wins) |
autoIncrementVersionCode = true |
Increments versionCode each build (1 → 2 → 3 … ) |
Neither set | Fallback: semver-derived (major*1000000 + minor*1000 + patch ) |
🔧 Example
tauri.conf.json
"bundle": {
"android": {
"autoIncrementVersionCode": true
}
}
Build 1 → tauri.properties
tauri.android.versionName=1.0.0
tauri.android.versionCode=1
Build 2 → tauri.properties
tauri.android.versionName=1.0.0
tauri.android.versionCode=2
Alternatives considered
No response
Additional context
No response