Error:(9, 5) error: resource android:attr/dialogCornerRadius not found

Dipti Belurgikar picture Dipti Belurgikar · Mar 14, 2018 · Viewed 126.5k times · Source

So I installed android studio 3.0.1 and as soon as it opened the gradle built and showed the following errors. I tried adding dependencies such as design and support but in vain. Could someone help me? Thank you in advance. enter image description here

It shows that some attributes such as dialogCornerRadius and fontVariation Settings not found.

Answer

Sheharyar Ejaz picture Sheharyar Ejaz · May 23, 2018

This error occurs because of mismatched compileSdkVersion and library version.

for example:

compileSdkVersion 27
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'

and also avoid to use + sign with library as in the following:

implementation 'com.android.support:appcompat-v7:26.+'

use exact library version like this

implementation 'com.android.support:appcompat-v7:26.1.0'

Using + sign with the library makes it difficult for the building process to gather the exact version that is required, making system unstable, hence should be discouraged.