Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suddenly I'm getting java.lang.IncompatibleClassChangeError #5

Open
topex-psy opened this issue Dec 20, 2018 · 2 comments
Open

Suddenly I'm getting java.lang.IncompatibleClassChangeError #5

topex-psy opened this issue Dec 20, 2018 · 2 comments

Comments

@topex-psy
Copy link

It works fine before, but since about 2 days ago, my app crash. Here's the error log:

java.lang.IncompatibleClassChangeError: Class 'com.ferfalk.simplesearchview.SimpleSearchView$5' does not implement interface 'com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener' in call to 'void com.google.android.material.tabs.TabLayout$BaseOnTabSelectedListener.onTabSelected(com.google.android.material.tabs.TabLayout$Tab)' (declaration of 'com.google.android.material.tabs.TabLayout$1' appears in /data/app/com.jukat.jualdekat-1/base.apk:classes2.dex)
		at com.google.android.material.tabs.TabLayout$1.onTabSelected(TabLayout.java:783)
		at com.google.android.material.tabs.TabLayout.dispatchTabSelected(TabLayout.java:1730)
		at com.google.android.material.tabs.TabLayout.selectTab(TabLayout.java:1723)
		at com.google.android.material.tabs.TabLayout.selectTab(TabLayout.java:1691)
		at com.google.android.material.tabs.TabLayout$Tab.select(TabLayout.java:2028)
		at com.google.android.material.tabs.TabLayout.addTab(TabLayout.java:667)
		at com.google.android.material.tabs.TabLayout.addTab(TabLayout.java:649)
		at com.google.android.material.tabs.TabLayout.addTab(TabLayout.java:628)
		at com.jukat.jualdekat.EtalaseActivity$muatTab$1.onResponse(EtalaseActivity.kt:114)
		at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:70)
		at android.os.Handler.handleCallback(Handler.java:815)
		at android.os.Handler.dispatchMessage(Handler.java:104)
		at android.os.Looper.loop(Looper.java:207)

Script to generate the tabs:

tab_subkategori.removeOnTabSelectedListener(tabListener)
tab_subkategori.removeAllTabs()
listSubKategoriLbl.clear()
listSubKategoriVal.clear()
for ((i, k) in res.lisT_KATEGORI.withIndex()) {
    listSubKategoriLbl.add(k.label)
    listSubKategoriVal.add(k.value)
    tab_subkategori.addTab(tab_subkategori.newTab().setCustomView(R.layout.yukari_tab_small)) <-- this line (114)
    val tab = tab_subkategori.getTabAt(i)!!
    val customTab = tab.customView!!
    customTab.findViewById<TextView>(R.id.lbl_tab).text = k.label
    customTab.findViewById<TextView>(R.id.num_tab).visibility = View.GONE
    tab.tag = k.label
}
tab_subkategori.addOnTabSelectedListener(tabListener)
subkategori = res.lisT_KATEGORI[0].label
setupViewPager()
@topex-psy
Copy link
Author

topex-psy commented Dec 23, 2018

apparently this happened after I updated the gradle to implementation 'com.google.android.material:material:1.1.0-alpha02' from alpha01. How to solve it?

@topex-psy
Copy link
Author

This is my layout code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	xmlns:tools="http://schemas.android.com/tools"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:background="#fff"
	android:orientation="vertical"
	tools:context=".EtalaseActivity">

	<com.google.android.material.appbar.AppBarLayout
		android:id="@+id/appbar"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:background="@color/colorPrimary"
		android:theme="@style/AppTheme.AppBarOverlay">

		<FrameLayout
			android:id="@+id/toolbar_container"
			android:layout_width="match_parent"
			android:layout_height="56dp"
			android:background="@color/colorPrimaryDark"
			android:elevation="4dp">

			<androidx.appcompat.widget.Toolbar
				android:id="@+id/nav"
				android:layout_width="match_parent"
				android:layout_height="56dp"
				android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
				app:popupTheme="@style/PopupMenuStyle"
				app:title="Etalase Saya" />

			<com.ferfalk.simplesearchview.SimpleSearchView
				android:id="@+id/searchView"
				android:layout_width="match_parent"
				android:layout_height="match_parent"
				android:background="#fff"
				app:type="bar"
				app:voiceSearch="true" />

		</FrameLayout>

		<com.google.android.material.tabs.TabLayout
			android:id="@+id/tab_subkategori"
			android:layout_width="match_parent"
			android:layout_height="40dp"
			android:background="#fff"
			app:tabIndicatorColor="@color/colorPrimary"
			app:tabMode="scrollable"
			app:tabSelectedTextColor="@color/textBlack"
			app:tabTextAppearance="@style/MyTabText"
			app:tabTextColor="@color/textDarkGray">

		</com.google.android.material.tabs.TabLayout>

	</com.google.android.material.appbar.AppBarLayout>

	<FrameLayout
		android:layout_width="match_parent"
		android:layout_height="0dp"
		android:layout_weight="1">

		<androidx.viewpager.widget.ViewPager
			android:id="@+id/viewPager"
			android:layout_width="match_parent"
			android:layout_height="match_parent" />

		<include layout="@layout/content_progress_full" />

	</FrameLayout>

</LinearLayout>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant