Android Gradle Error When Sync Style Attribute Not Found

Gradle build error styles attributes not found

Go to your gradle.properties write the below code and Sync your project

android.enableAapt2=false

And remove @ symbol because from Android Studio 3.0

When referencing resources from the 'android' namespace, omit the '@' symbol.

Android gradle error when sync style attribute not found

From Your Error Log seems Like you are getting this error because of

error: style attribute 'attr/roundSelector (aka
com.example.adend.timetable:attr/roundSelector)' not found.

So Please check this

@drawable/round_selector_dark

you have this round_selector_dark in your drawable or not .

there are multiple errors and all are regarding your style.xml

So double check your style.xml elements.

Gradle build error style attributes not found

That is a problem with themes and styles. Probably one of your libraries is expecting that style to be available and it's not finding it. See here Cant set Android Actionbar Background correctly as a guide on how to fill in that particular attribute that may work for you.

This resource seems to have been introduced in 2013 according to google's diffs here https://android.googlesource.com/platform/tools/base/+/f5215ae4712f468568b58c20baadd14b769c10c4%5E!/

Changing your themes.xml followed by using it from the manifest, or changing styles.xml can potentially cause those side effects if not done properly.

Style attribute attr/@attr/minTextSize not found

The issue is with some of the gradles added in project.
Actually the libraries internally have defined the attribute minTextSize

Due to latest updates and compatibility the attr was not found.

To identify I have defined same attr as

<attr name="minTextSize" format="integer">16</attr>

in attrs.xml in my app module.
Compiling the same thrown error of duplicate value and path and from that path I have found the library which needs to be updated.

Updating to the latest of all library version have solved the issue.

Gradle error when sync project in Android Studio 3

related to this answer => roundIcon is an attribute that was first introduced for Android O (8.0, API level 25), therefore you have two available options based on the type of device you're targeting:

  • If you're building an app specifically for Android O, ensure that minSdkVersion and targetSdkVersion are set to 25 in your app's build.gradle:

defaultConfig {
minSdkVersion 25
targetSdkVersion 25
}

  • Alternatively, if you want to target older API levels, you will need to remove android:roundIcon from your manifest and only use android:icon.

error: resource android:attr/fontVariationSettings not found

try to change the compileSdkVersion to:

compileSdkVersion 28

fontVariationSettings added in api level 28. Api doc here



Related Topics



Leave a reply



Submit