将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)
这是屏幕截图。
如果我将同一类文件复制到另一个新项目,则不会出现警告。仅旧项目显示这些警告。这是我的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 -> …