The fundamental reason is that this resource cannot be found, two reasons
1. The compileSdkVersion version is too low.
Upgrade compileSdkVersion to 28 or 30
compileSdkVersion 28
Because fontVariationSettings and ttcIndex were added in api 28
2. Adjust the dependent appcompat version number
This may be because some versions are abnormal, resources are missing, and the newly created project uses an abnormal version number. The following are the normally available version numbers.
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'