
Recently I suddenly could not see class scoped variables in Android Studio (version 3.4.1). This turned out to be because I had enabled minifyEnabled in the app build.gradle file. And minifyEnabled was set to true because I was receiving a build error: Error: null, Cannot fit requested classes in a single dex file (# methods: 98727 > 65536).
Quick answer to this solution: enable multidex in your debug section in your build.gradle file as follows:
buildTypes {
debug {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexEnabled = true
}
}