Introduction
When uploading your Android App Bundle to the Google Play Console, you may encounter the error:
Version code 2 has already been used
This means the numeric versionCode in your AAB matches one already published or in draft. Google Play requires each upload to use a strictly higher versionCode.
Every Android release is identified by an integer versionCode. If you attempt to upload a new build with a versionCode that’s equal to or lower than one you’ve previously uploaded, the Play Console will reject it.
Increment the Version Code
- Open your app’s build.gradle (module-level) or your BuddyBoss App plugin’s Android settings.
- Locate the versionCode entry.
- Increase it to a unique, higher integer (e.g., from 2 to 3).
- Save your changes.
Generate a New Release AAB
- In WordPress, go to BuddyBoss App > Build.
- Select Release and click Send Build Request.
- Confirm that the new AAB reflects your updated versionCode in Step 2: Review Information.
Upload to Google Play Console
- Open the Play Console and navigate to Release > Production (or your track).
- Click Create new release.
- Upload the newly generated .aab file.
- Continue through the release flow—your build should now be accepted.
Do I Need to Generate a New Build?
Yes. Bumping the versionCode necessitates building a fresh AAB so that the updated code is embedded in your app package.
Troubleshooting and FAQs
Q: How do I check my current versionCode in Google Play?
A: In Google Play Console, go to Release > App Bundle Explorer. Each uploaded AAB shows its versionCode.
Q: Why can’t I reuse the same versionCode?
A: Google Play mandates each new upload use a strictly higher versionCode to identify updates correctly.
Q: What if I accidentally skip a versionCode?
A: It’s safe to skip numbers (e.g., jump from 2 to 10). Just ensure each new build’s code is greater than the last.
Q: I incremented versionCode but still get the error—why?
A: Confirm you rebuilt and re-uploaded the fresh AAB. Clear any cached build artifacts and retry the build process.