我将尝试更改Android应用程序的版本代码和版本名称,但它会出现以下错误

时间:2016-07-16 16:16:56

标签: android version

C:\Users\hp-\IdeaProjects\new\app\build.gradle
Error:(11, 0) Gradle DSL method not found: 'versionCode()'
Possible causes:<ul><li>The project 'new' may be using a version of Gradle  that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li>
<li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>  

这是如何解决它的错误?

我将在build.gradle中更改如下

   defaultConfig {
    applicationId "  name.name"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1.1
    versionName "1.1"
     }

1 个答案:

答案 0 :(得分:0)

你不能使用versionCode的浮点数。你必须使用整数。 只有versionCode必须比以前的versionCode更像:

1,2,3,4,......