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'
Did you add the android plugin on top of the gradle file?
apply plugin: 'android'
Version code needs to be an integer by the way! switch from 5.1 to 5 and it will work!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With