Assigned
Status Update
Comments
ja...@google.com <ja...@google.com>
je...@google.com <je...@google.com> #2
Proof of concept demo on Github: https://github.com/casperbang/MissingNonLocalizedDrawableCrash
No problem compiling, lint'ing or running the app on a Danish device. Crash when running on a device set to any other locale.
No problem compiling, lint'ing or running the app on a Danish device. Crash when running on a device set to any other locale.
Description
I have function defined in my main source set that operates on a type only available on API 21 or newer.
import android.widget.Toolbar
@RequiresApi(21)
fun Toolbar.hideOverflowMenu2() = hideOverflowMenu()
I then write an androidTest/ for this
class ToolbarExtensionTest {
@Test fun extension() {
val toolbar = Toolbar(context)
assertTrue(toolbar.hideOverflowMenu2())
}
}
With checkTestSources true and a minSdk of 14, lint should flag the use of hideOverflowMenu2 in the NewApi check. The test class/function needs to be annotated with @SdkSuppress(minSdkVersion = 21) then.