在android studio中导入(Mateial Design日历)库模块时出现问题

时间:2015-11-05 11:35:32

标签: android android-studio import module

我收到此错误,如何修复它。 错误:(12,0)无法获取属性' versionCodeInt'关于额外属性扩展,因为它不存在

  defaultConfig {
    minSdkVersion 14
    targetSdkVersion 23
    versionCode project.ext.versionCodeInt -> getting error this line
    versionName version
}

2 个答案:

答案 0 :(得分:0)

  

错误:(12,0)无法获取属性' versionCodeInt'关于额外的属性   扩展,因为它不存在

此错误意味着您尝试在模块级别的build.gradle中使用的变量versionCodeInt未在Project的根级别的build.gradle文件中正确设置。

因此,请检查root build.gradle是否包含此类代码:

project.ext {
    versionCodeInt = 2 // actually here should be your current version code
}

答案 1 :(得分:0)

试试这个,它为我工作

defaultConfig {
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }