After updating Android studio to 2.1.2 my code is littered with warnings when I imported my old project into it. Warnings:
Instance field name doesn't match regex '[az]+' Local variable name doesn't match regex '[az]+' Instance field access is not qualified with 'this'
Here is a screenshot.
![A local variable or instance field name does not match the regular expression '[az] +'](http://qaru.site/img/17965854b1a4f405ceb4f48825bdf1fe.png)
If I copy the same class file to another new project, there will be no warnings. These warnings only warn the old project. Here is 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 , this did not help. I would like to solve the problem and not ignore the warnings. Any help is much appreciated. Thanks.
android regex intellij-idea android-studio gradle
Yogesh Umesh Vaity
source share