After upgrading Android studio to 2.1.2
, my code is littered with warnings when I imported my old project into it. The warnings are :
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'
Here's the screenshot.
If I copy this same class file to another new project, there are no warnings. Only old project shows these warnings. Here's my build.gradle file:
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'
}
I tried File menu -> Invalidate caches / Restart
, it didn't help.
I would like to solve the problem instead of ignoring the warnings.
Any help is much appreciated. Thank you.
Your Inspection profile has been changed. You can restore that in this manner.
or
Disabling any unwanted inspection from the list.
or
Creating your own inspector profile.
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