I'm using a library with a class that extends TabLayout. I'm trying to build with the latest support libraries:
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:preference-v14:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
This results in a crash:
java.lang.NoSuchMethodError: No virtual method setOnTabSelectedListener(Landroid/support/design/widget/TabLayout$OnTabSelectedListener;)
This is the source from the decompiled TabLayout.class
file (It doesn't seem to have a source jar like other versions):
/** @deprecated */
@Deprecated
public void setOnTabSelectedListener(@Nullable TabLayout.BaseOnTabSelectedListener listener) { ... }
public interface OnTabSelectedListener extends TabLayout.BaseOnTabSelectedListener<TabLayout.Tab> {
}
public interface BaseOnTabSelectedListener<T extends TabLayout.Tab> { ... }
It works with 27.1.1 and earlier versions where the source looks like so:
/**
* @deprecated Use {@link #addOnTabSelectedListener(OnTabSelectedListener)} and
* {@link #removeOnTabSelectedListener(OnTabSelectedListener)}.
*/
@Deprecated
public void setOnTabSelectedListener(@Nullable OnTabSelectedListener listener) { ... }
/**
* Callback interface invoked when a tab's selection state changes.
*/
public interface OnTabSelectedListener { ... }
I'm running in Genymotion with Samsung Galaxy S8 - API 26 - 1440x2960.
I'm not sure if there's an issue with the design:28.0.0 library or maybe I'm just doing something wrong in the build. It seems to work OK with earlier versions. Any advice is appreciated.