An Android I have compiles well but at runtime it throws an error:
Fatal error: android.os.Build$VERSION_CODES.LOLLIPOP
java.lang.NoSuchFieldError: android.os.Build$VERSION_CODES.LOLLIPOP
For this code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
//....
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
//.....
The similar error gets thrown for Build.VERSION_CODES.KITKAT_WATCH
.
These constants do exist when I click on them in IDE but I believe they somehow get cut out from the result apk.