如何修复“无法加载未知错误的AppCompat ActionBar”。对于API 28?

时间:2018-07-15 14:21:49

标签: android android-appcompat

这个问题是重复的 Failed to load AppCompat ActionBar with unknown error in android studio

但是API 28再次出现相同的错误。我的build.gradle如下所示:

    apply plugin: com.android.application
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.android.application"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 3
        versionName "1.3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug{
            ext.enableCrashlytics = false
            ext.alwaysUpdateBuildId = false
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha3'
    implementation 'com.android.support:support-media-compat:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.jjoe64:graphview:4.2.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 files('libs/graphview-4.2.2-javadoc.jar')
}

此问题的解决方法是什么?

2 个答案:

答案 0 :(得分:4)

使用实现'com.android.support:support-media-compat:28.0.0-alpha1'代替实现'com.android.support:support-media-compat:28.0.0-alpha3'。

答案 1 :(得分:-1)

在您的Gradle文件中使用:

CI_DEBUG_TRACE