I get this error when I install my release APK on a 5.x
device. The error does not occur when I push the same code from Android Studio, or if I run it on a
In my case the method that the error message said was 'bad', had some unknown faults. Changing from a Kotlin lambda to a regular loop solved my issue.
Before (With Error):
fun validZipCode(zipcode: String): Boolean {
val validRegexes = arrayOf(
"0[0-9]{1}[0-9]{2}",
"1[0-2]{1}[0-9]{2}",
"1[3-4]{1}[0-9]{2}",
"19[0-9]{2}",
"2[0-1]{1}[0-9]{2}"
)
return validRegexes.any { zipcode.matches(it.toRegex()) }
After:
fun validZipCode(zipcode: String): Boolean {
val validRegexes = arrayOf(
"0[0-9]{1}[0-9]{2}",
"1[0-2]{1}[0-9]{2}",
"1[3-4]{1}[0-9]{2}",
"19[0-9]{2}",
"2[0-1]{1}[0-9]{2}"
)
for (regex in validRegexes) {
if (zipcode.matches(regex.toRegex())) {
return true
}
}
return false
}
Simple (3) steps worked for me:
1 - from top menu of android studio build --> clean project
2 - from top menu of android studio build --> make project
3 - from top menu of android studio build --> rebuild project
All set up..
Verify Error is majorly thrown in certain scenarios which occurs if we changed definition of class A, but class B was compiled using an older version of the class A. That's why it gets resolved if we clear our project and rebuild all the classes together with same version of Java.
Following link lists some of the scenarios where Verify error might occur. java.lang.VerifyError – How to solve VerifyError
May be this can help some one who is facing this issue in Debug Build as well.
I was also facing the same error.I missed to Configure Google API Console project. So Configure Google API Console project following this and specify your app's package name when prompted. You will also need to provide the SHA-1 hash of your signing certificate. See Authenticating Your Client for information.