I androidStudio newly downloaded, everything is the default configuration, why the startup error?

I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
           at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
           at void android.support.v7.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)




 Caused by: java.lang.ClassNotFoundException: Didn"t find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.qky.qingchi.myapplication-2/base.apk"],nativeLibraryDirectories=[/data/app/com.qky.qingchi.myapplication-2/lib/x86, /system/lib, /vendor/lib]]
           at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
           at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
           at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)


           

build.gradle:

apply plugin: "com.android.application"

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.qky.qingchi.myapplication"
        minSdkVersion 16
        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"
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    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"
}

styles.xml:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

Base.Theme.AppCompat.Light.DarkActionBar is that I added base, in front of it. If you don"t add it, you can"t preview it on the right, and I don"t know why

are all the default configurations. I am furious. How can such a powerful thing like as be so rubbish?

there is a search on the Internet that there is any mismatch between the default configuration of sdk tools 26.1.1 and this com.android.support:appcompat-v7:28.0.0-rc01, and why it does not match, ah, it is not clear,

https://blog.csdn.net/weixin_37651459/article/details/80956366

I hope those who understand will let me know, thank you,

if the project can run normally, it will report an error, but it will not affect the use of

.
Apr.17,2021

found the cause of the problem

the api version used in build.gradle is 28. Before selecting a virtual machine, the selected api level is 27. Then 28 api, is used in the project, so an error is reported, and the virtual machine uses 28 api.

clipboard.png

Menu