Kotlin/anko

No virtual method setForeground

Closed this issue · 3 comments

abond commented

java.lang.NoSuchMethodError: No virtual method setForeground(Landroid/graphics/drawable/Drawable;)V in class Lorg/jetbrains/anko/_LinearLayout; or its super classes

Same error for org/jetbrains/anko/appcompat/v7/_LinearLayoutCompat.

Error appears on API level 21. On API 23 everything works fine.
In XML layouts everything works on both API levels.
As I understand setForeground available from API lvl 1.

abond commented

Find out that it is official android documentation error.
The method introduced in API lvl 23 View.setForegroud, is reported to be API level 1 on the Android Developer Guide.

yanex commented

So I think the issue can be closed? :)

abond commented

Ofcourse😃