相关疑难解决方法(0)

局部变量或实例字段名称与正则表达式“ [az] +”不匹配

将Android Studio升级到后,将2.1.2旧项目导入到我的代码中时,就会出现警告。警告是:

Instance field name doesn't match regex '[a-z]+'
Local variable name doesn't match regex '[a-z]+'
Instance field access is not qualified with 'this'
Run Code Online (Sandbox Code Playgroud)

这是屏幕截图。

局部变量或实例字段名称与正则表达式“ [az] +”不匹配

如果我将同一类文件复制到另一个新项目,则不会出现警告。仅旧项目显示这些警告。这是我的build.gradle文件:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 10
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.1.0'
    compile 'com.android.support:design:24.1.0'
    androidTestCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)

我尝试过File menu -> …

regex android intellij-idea gradle android-studio

5
推荐指数
1
解决办法
1029
查看次数

标签 统计

android ×1

android-studio ×1

gradle ×1

intellij-idea ×1

regex ×1