According to this answer How to solve "Your APK's version code needs to be higher than 2." in Google Play's Developer Console? I have just changed the vers
In my case I had something like this in my AndroidManifest,
javaCompileOptions {
annotationProcessorOptions {
arguments = [
'androidManifestFile': 'app\\build\\intermediates\\merged_manifests\\debug\\processDebugManifest\\merged\\AndroidManifest.xml'
]
}
}
here the 'androidManifestFile' location is wrong, changed it to
"androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString()
everything worked
In my app/build.gradle file , version code was like this:-
In place of versionCode flutterVersionCode.toInteger() , i replaced it with as versionCode 2
Sometimes the PlayStore encounters a bug when you upload an APK during a Release creation, and you are stuck because you cannot upload the same APK again, for the current draft release. You get the error "Upload failed..."
The solution is to go to the Artifact library menu, under Release management and to delete the draft artifact. Once this is done, you will be able to upload the APK again, and to finish your release.
Hope it will help others...
Ben
In Flutter
Update version:1.0.0+1 in pubspec.yaml.
The default version number of the app is 1.0.0. To update it, navigate to the pubspec.yaml file and update the following line:
version: 1.0.0+1
+1 (the number after the +) represents the versionCode such as 1, 2, 3, etc.
So increase it one by one, like this
version: 1.0.1+2
The version number is three numbers separated by dots, such as 1.0.0 in the example above, followed by an optional build number such as 1 in the example above, separated by a +.
Both the version and the build number may be overridden in Flutter’s build by specifying --build-name and --build-number, respectively.
In Android, build-name is used as versionName while build-number used as versionCode. For more information, see Version your app
After updating the version number in the pubspec file, run flutter pub get from the top of the project, or use the Pub get button in your IDE. This updates the versionName and versionCode in the local.properties file, which are later updated in the build.gradle file when you rebuild the Flutter app.
If you're using Building Standalone Apps with Expo, the versionCode error might creep up owing to the fact that the standard app.json config only has a reference to the version property.
I was able to add a versionCode property under android as follows:
Sample App.json
{
"expo": {
"sdkVersion": "29.0.0",
"name": "App Name",
"version": "1.1.0",
"slug": "app-name",
"icon": "src/images/app-icon.png",
"privacy": "public",
"android": {
"package": "com.madhues.app",
"permissions": [],
"versionCode": 2 // Notice the versionCode added under android.
}
}
}
Detailed documentation: https://docs.expo.io/versions/v32.0.0/workflow/configuration/#versioncode
If you get this error for your Flutter App's Android APK, in your app/build.gradle file under defaultConfig {}
comment out
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
and add
versionCode 2
versionName "2"
or "previous version code" + 1.