简体   繁体   中英

resource android:style/TextAppearance.Material not found

I am trying to write a Hello World program for android. This is my first experience of Java. Gradle is not running properly, and whenever I try to rerun it, it comes up with 24 error messages:

resource android:style/TextAppearance.Material not found

and then lots of attributes of android:style/TextAppearance.Material which are also not found. I have tried searching online for how to put something in styles.xml to fix this, but can't find anything useful.

Try to change you theme to an Android Support Library's material design theme. Don't forget to include the Support Library as well.

Manifest:

<application android:theme="@style/Theme.AppCompat">

Gradle Build file:

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.0'
}

I would also recommend to you that you read the Styles and Themes documentation. https://developer.android.com/guide/topics/ui/look-and-feel/themes.html

In my case the problem was this:

configurations {
    compile.exclude group: 'androidx.annotation', module: 'annotation'
    compile.exclude group: 'androidx.core', module: 'core'
}

had to comment this block out and it worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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