i was using android support v7 recyclerView in my xml layout file in android
<android.support.v7.widget.RecyclerView
android:id="@+id/messagelist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:clipToPadding="false"
android:scrollbars="vertical" />
i switched to androidx so i changed the recycler view to androidx recyclerView like this :
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/messagelist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:clipToPadding="false"
android:scrollbars="vertical" />
so i got this error :
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.yassineghr.chatdemov2-2/base.apk"],nativeLibraryDirectories=[/data/app/com.yassineghr.chatdemov2-2/lib/x86, /system/lib, /vendor/lib]]
this is my gradle build file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.yassineghr.chatdemov2"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == "androidx") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "${targetSdk}.+"
}
}
}
}
}