Can't update VersionCode

2019-08-03 09:49发布

问题:

I have published an app on Google Play 15 days ago, I made some modifications to the app and now I want to publish it again .

When I tried to upload the apk without changing the VersionCode="1" the Google Developers Console gave me an Error: App with versionCode="1" already exist.

Then I tried to change the version code to 2 and export the apk, unfortunately the VersionCode reverts back to "1" always.

Please help out with this issue.

回答1:

Make sure you are NOT using the bin/manifest as this is the built one, and will constantly be changed on build/export.

Use the proper manifest which can be found in the root directory of the project.

I too did this for a while by accidently opening the bin folder and was baffled.



回答2:

I've had this problem even when editing the proper manifest file (not bin/manifest) usually when editing a project from different machines.

In Eclipse, try "cleaning" the project and re-building. Should update the APK with the proper versions on your next install.



回答3:

I had same problem. I have changed 3 versions untill was done. There are many possibilities. You didn't type the key (password) correctly, Second try to Deactivate the first version then upload the new version. Try not to forget to change Version Code and Version name, and Export APK as first time. Hope it will help you.



回答4:

If you are using gradle to build you must change it on build.gradle: android { compileSdkVersion 21 buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.xx.sadsa"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 3
    versionName "1.0"
}

}



回答5:

Also, if you're in Android Studio: Build > Generate Signed APK...



回答6:

None of Above does not work in my case. Go to File->Invalidate Cache/Restart work for me



回答7:

I wasn't able to upload the apk to google play console (Note: I have updated the version name and version code in build.gradle) after lot of searching in my case just cleaning of the project was good enough and I was able to upload the apk to console.