webentwicklung-frage-antwort-db.com.de

OnUnhandledKeyEventListener-Klasse nicht gefunden

Ich habe bei jedem Support-Design-Widget einen Fehler. Wie beim Recyclerview, beim Koordinatorlayout usw. Jedes Mal füge ich ein unterstützendes Design-Widget hinzu 

Java.lang.ClassNotFoundException: Android.view.View$OnUnhandledKeyEventListener

auf Layout-Abschnitt. Ich verwende api 28.0.0-rc01, gradle 4.4 Android 3.1.4. Hier ist meine build.gradle (app) Datei

    apply plugin: 'com.Android.application'

Android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.Android.test5test"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "Android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.pro'
        }
    }
    buildToolsVersion '28.0.2'
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.Android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.Android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.Android.support.test:runner:1.0.2'
    androidTestImplementation 'com.Android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.Android.support:design:28.0.0-rc01'
    implementation 'com.Android.support:cardview-v7:28.0.0-rc01'
    implementation 'com.Android.support:recyclerview-v7:28.0.0-rc01'
}

Hier ist meine Layoutdatei

<LinearLayout
    xmlns:Android="http://schemas.Android.com/apk/res/Android"
    xmlns:app="http://schemas.Android.com/apk/res-auto"
    Android:layout_width="match_parent"
    Android:layout_height="match_parent"
    Android:orientation="vertical">

    <Android.support.design.widget.AppBarLayout
        Android:layout_width="match_parent"
        Android:layout_height="wrap_content">

        <Android.support.design.widget.TabLayout
            Android:id="@+id/work_tab"
            Android:layout_width="match_parent"
            Android:layout_height="wrap_content"
            app:tabIndicatorHeight="5dp"
            app:tabTextColor="@color/white"
            app:tabSelectedTextColor="@color/colorAccent"
            app:tabGravity="fill"
            app:tabMode="fixed" />

    </Android.support.design.widget.AppBarLayout>

</LinearLayout>

Hier ist der Stack-Trace des Fehlers

Java.lang.ClassNotFoundException: Android.view.View$OnUnhandledKeyEventListener
    at org.jetbrains.Android.uipreview.ModuleClassLoader.load(ModuleClassLoader.Java:180)
    at com.Android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.Java:61)
    at org.jetbrains.Android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.Java:118)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:424)
    at Java.lang.ClassLoader.loadClass(ClassLoader.Java:357)
    at org.jetbrains.Android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.Java:213)
    at Android.support.design.widget.TabLayout$SlidingTabIndicator.setSelectedIndicatorHeight(TabLayout.Java:2402)
    at Android.support.design.widget.TabLayout.<init>(TabLayout.Java:425)
    at Android.support.design.widget.TabLayout.<init>(TabLayout.Java:399)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at Sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.Java:62)
    at Sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.Java:45)
    at Java.lang.reflect.Constructor.newInstance(Constructor.Java:423)
    at org.jetbrains.Android.uipreview.ViewLoader.createNewInstance(ViewLoader.Java:481)
    at org.jetbrains.Android.uipreview.ViewLoader.loadClass(ViewLoader.Java:264)
    at org.jetbrains.Android.uipreview.ViewLoader.loadView(ViewLoader.Java:222)
    at com.Android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.Java:209)
    at Android.view.BridgeInflater.loadCustomView(BridgeInflater.Java:337)
    at Android.view.BridgeInflater.loadCustomView(BridgeInflater.Java:348)
    at Android.view.BridgeInflater.createViewFromTag(BridgeInflater.Java:248)
    at Android.view.LayoutInflater.createViewFromTag(LayoutInflater.Java:730)
    at Android.view.LayoutInflater.rInflate_Original(LayoutInflater.Java:863)
    at Android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.Java:72)
    at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:837)
    at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:824)
    at Android.view.LayoutInflater.rInflate_Original(LayoutInflater.Java:866)
    at Android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.Java:72)
    at Android.view.LayoutInflater.rInflate(LayoutInflater.Java:837)
    at Android.view.LayoutInflater.rInflateChildren(LayoutInflater.Java:824)
    at Android.view.LayoutInflater.inflate(LayoutInflater.Java:515)
    at Android.view.LayoutInflater.inflate(LayoutInflater.Java:394)
    at com.Android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.Java:325)
    at com.Android.layoutlib.bridge.Bridge.createSession(Bridge.Java:384)
    at com.Android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.Java:193)
    at com.Android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.Java:544)
    at com.Android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.Java:678)
    at Java.util.concurrent.FutureTask.run(FutureTask.Java:266)
    at Java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.Java:1142)
    at Java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.Java:617)
    at Java.lang.Thread.run(Thread.Java:745)

Ich habe die View-Klassendatei überprüft, aber der "OnUnhandledKeyEventListener" befand sich dort. Ich weiß nicht, warum dieses Problem auftritt. Bitte sagen Sie mir, wie ich dieses Problem lösen kann.

3
Anirban Das

Öffnen Sie den Ordner styles.xml in app> src> main> res> values ​​und ändern Sie diese Zeile

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

zu

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
4
anons

Derzeit gibt es leider keine Problemumgehung. Android.support.v4.view.ViewCompat implementiert View.OnUnhandledKeyEventListener nicht im androidx-Paket .. _. Der Fehler wurde here eingereicht.

0
netpork