Android studio 无法加载AppCompat ActionBar,出现未知错误。提示:尝试刷新布局

Android studio 无法加载AppCompat ActionBar,出现未知错误。提示:尝试刷新布局,android-studio,Android Studio,我寻找了一些已经被问到的问题,但它们是在旧版本的android studio上,不能工作。正如你所看到的,我不知道;没有buildToolsVersion、compile和classpath .我的格拉德尔 apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.illuminat.butto

我寻找了一些已经被问到的问题,但它们是在旧版本的android studio上,不能工作。正如你所看到的,我不知道;没有buildToolsVersion、compile和classpath .我的格拉德尔

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.illuminat.button"
        minSdkVersion 22
        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-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'
}
  • 打开app Build.gradle文件
  • 在依赖项中替换:“com.android.support:appcompat-v7:28.0.0-alpha3” 'com.android.support:appcompat-v7:28.0.0-alpha1'

  • Clic同步


  • 在res/values/style.xml中,将style标记更改为

    即使修复涉及更改为较旧且可能存在更多错误的dep,它也确实完成了任务。我应该将资源文件标记更改为什么??