Failed to load AppCompat ActionBar with unknown error?

后端 未结 5 1506
执念已碎
执念已碎 2021-01-02 06:26

build.gradle file

    apply plugin: \'com.android.application\'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId \"io.d         


        
相关标签:
5条回答
  • I fix this error using 3 methods on YouTube

    0 讨论(0)
  • 2021-01-02 07:18

    Set your target sdk version to 27 . Set your compile sdk version to 27 . And app compat version from 28.0.0-alpha3 to 27.1.1 .

    If you still want to use sdk version 28

    Just replace alpha3 to alpha1 without changing anything else

    0 讨论(0)
  • 2021-01-02 07:21

    This worked for me when that happened, I dont know why it doesn't work with 28:

    //use this instead 
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    targetSdkVersion 27
    
    dependencies{
    
    //switch to these
    implementation 'com.android.support:appcompat-v7:27.0.0-alpha'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:27.0.0'
    
    }
    
    0 讨论(0)
  • 2021-01-02 07:23

    This worked for me.

    Open, res --> values --> styles.xml, here you will find a line like this:

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    

    change it to:

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

    In otherwords, change DarkActionBar to NoActionBar

    0 讨论(0)
  • 2021-01-02 07:25

    I had the same problem. Seems it is a Android Studio bug.

    In your styles xml-file change this:

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

    to this:

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

    Works for me.

    0 讨论(0)
提交回复
热议问题