I\'m trying to get my application to save some data when the orientation of the screen is changed using the onSaveInstanceState
to save a boolean value mC
It turns out there wasn't a problem with the code and that Android Studio required a restart. I think it was down to the fact I had cloned the project and was possibly using an incorrect file from the previous version.
Check if your build variant in Android Studio has
I got the same error and I wasted my 3-4 hours to resolve same error finally I got to know why that happened and it was interesting
In my case, I changed the code in one file (I declared one variable and initialized it)
I run the apk from my device and attached debugger from android studio
I set debug point to that newly added variable where I assigned data to it
but during debugging it shows me same error
Then I got to know I changed the code in file but I run the apk from device, and I attached debugger I need to compile and run the changes instead of it how it will reflect in apk that was the actual issue
So I compiled and ran the code and installed newly compiled apk on device then I attached debugger and it worked for me
hope this will save someone's time
I had the same error. The solution to the error is to disable the Proguard in build.gradle file.
debug {
minifyEnabled false
}
If you're using pro-guard and obfuscation is true. you have to comment out obfuscation in build gradle
eg: add this in the pro-guard -dontobfuscate
In case this comes in handy for anyone else, I was able to resolve this issue immediately once I realized I was in 'Release' mode, not 'Debug' mode, in the Build Variants section.