Failed to load AppCompat ActionBar with unknown error.Android Studio 3.1.3

前端 未结 4 1818
故里飘歌
故里飘歌 2021-02-04 22:58

This was my first time using Android studio and I dont know what are those errors mean or what they implyenter image description here

[Render Problem Fa

相关标签:
4条回答
  • 2021-02-04 23:01

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

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

    Change DarkActionBar to NoActionBar

    0 讨论(0)
  • 2021-02-04 23:09

    Use stable version always

    Always use stable version of libraries. If you are developing an app, you don't want to face these type of errors.

    At the time of answering the current most stable version is 27.1.1 and second 28.0.0-rc02.

    I suggest use 27.1.1 until 28 stable version release.

    implementation 'com.android.support:appcompat-v7:27.1.1'
    
    • Sync again
    • No need of Invalidate/ Restart, Just restart would be okay. Or closing project and reopening from recent would be faster then restart.

    Track the support library release.

    0 讨论(0)
  • 2021-02-04 23:13

    Please change com.android.support:appcompat-v7:28.0.0-alpha3 to com.android.support:appcompat-v7:28.0.0-alpha1 in build.gradle(Module: App).

    And click File -> Invalidate Caches / Restart

    Of course you need internet access.

    It seems there is a bug in com.android.support:appcompat-v7:28.0.0-alpha3

    0 讨论(0)
  • 2021-02-04 23:17

    Missing Constraints in Constraint Layout :-

    It means some constraints values are not given like distance from the top ,bottom left and right .Here's a link to solve this problem.

    And another link if you want to know more about constraint layout

    If you are first time using Android studio then you should start with some simple layouts like linear or relative layout.

    Hardcoded text :-

    Ths is not an error but a warning. As a general rule, you should never use hardcoded strings in your layout but always use string resources (which means the all strings are stored in one separate file where they are easily changeable for different languages and so on).

    To convert a hard coded String to a string ressource:

    1:put the curser on the hard coded string

    2:press ALT + Enter

    3:enter a name for your resource

    4:click OK

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