I want to update my app on google play store, it can't accept the updated file with the same version.
Do I've changed the version from build.gradle file :
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "net.koorasudan.app"
minSdkVersion 14
targetSdkVersion 21
versionCode 5.1
versionName "5.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
But when I sync the gradle it shows me this error :
Error:(23, 0) Gradle DSL method not found: 'versionCode()' Possible causes:
The project 'SmartView 3' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file The build file may be missing a Gradle plugin. Apply Gradle plugin
How to solve this problem?
The versionCode
is an integer.
You can't use versionCode 5.1
in your build.gradle
Also you have to add this line at the beginning of your script.
apply plugin: 'com.android.application'
thank you too, i've add the line on the beginning of the script.
If this resolves your issue, please mark the answer as correct. It can help other users. thanks.
Changing the versionCode to an Integer works for me