简体   繁体   English

获取错误无法加载未知错误的AppCompat ActionBar。 在Android Studio中

[英]Getting error Failed to load AppCompat ActionBar with unknown error. in Android Studio

I would like to begin with a preface to inform you all that I have already seen almost every thread and question on this, so there is no point in linking me another thread on this. 我想以序言开头,告诉大家我已经看过几乎所有线程和问题,因此没有必要在此链接另一个线程。

So I have this error where I can't see anything in my layout (in Android studio). 所以我有这个错误,在布局中(在Android Studio中)看不到任何东西。 I have tried almost every solution that the internet has given me. 我尝试了互联网给我的几乎所有解决方案。 If there is anything I may have missed and you all know, let me know. 如果有什么我可能想念的,并且大家都知道,请告诉我。 Thanks! 谢谢!

EDIT: Here is the xml file: 编辑:这是xml文件:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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"
    tools:context=".MainActivity"
    tools:layout_editor_absoluteY="25dp">

    <EditText
        android:id="@+id/editText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:inputType="textEmailAddress"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/firstButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="firstButton"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/testButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        app:layout_constraintBottom_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toStartOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</android.support.constraint.ConstraintLayout>

build.gradle (Module: app): build.gradle(模块:应用程序):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "testing.abdullah.me.testtest"
        minSdkVersion 28
        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(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    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'
}

KEEP IN MIND: I do not know much about gradle, so if it is an issue with gradle, please do not just tell me to put something in, tell me whether to put it in dependencies, buildtypes, or anything else. 保持头脑:我对gradle知之甚少,因此,如果这与gradle有关,请不要仅仅告诉我放入某些东西,告诉我是否将其放入依赖项,构建类型或其他任何东西。

使用以前的版本alpha1代替alpha3:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM