[Solved] error: resource android:attr/fontVariationSettings not found

Warning:The android.dexOptions.incremental property is deprecated
and it has no effect on the build process.
Error:(246, 5) error: resource android:attr/fontVariationSettings not
Error:(246, 5) error: resource android:attr/ttcIndex not found.
Error:(269) resource android:attr/ttcIndex not found. Error:(269)
resource android:attr/fontVariationSettings not found.
java.util.concurrent.ExecutionException: AAPT2 error: check logs for
details Error:failed linking references.
Error:java.util.concurrent.ExecutionException: AAPT2 error: check logs for
details AAPT2 error:
check logs for details Error:Execution failed for task

Failed to execute aapt Information:9 errors Information:BUILD FAILED in 2s Information:1 warning Information:See complete output in console

How to solve this issue?
my dependencies

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('', {
        exclude group: '', module: 'support-annotations'

    compile 'de.hdodenhof:circleimageview:2.2.0'

    compile('[email protected]') {
        transitive = true
    compile('org.apache.httpcomponents:httpmime:4.3.6') {
        exclude module: 'httpclient'
    compile 'com.synnapps:carouselview:0.1.4'
    compile 'com.sun.mail:android-mail:1.5.5'
    compile 'com.sun.mail:android-activation:1.5.5'
    implementation 'com.muddzdev:styleabletoast:2.0.2'
    compile 'javax.annotation:javax.annotation-api:1.2'

    compile 'me.grantland:autofittextview:0.2.+'
    // base library
    compile ''
    //noinspection GradleCompatible
    compile 'jp.wasabeef:recyclerview-animators:2.2.7'
    compile ''
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile ''
    compile 'com.github.satyan:sugar:1.4'
    compile ''
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile ''
    compile ''
    compile 'com.github.satyan:sugar:1.4'
    compile 'jp.wasabeef:recyclerview-animators:2.2.6'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    compile 'com.afollestad.material-dialogs:core:'
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile ''
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'at.blogc:expandabletextview:1.0.3'
    compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.+'
    compile ''

    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    compile ''
    compile ''
    compile ''
    compile ''
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:[email protected]'
    compile ''
    testCompile 'junit:junit:4.12'
    implementation ''

Enquirer: Midhilaj


Solution #1:

try to change the compileSdkVersion to:

compileSdkVersion 28

fontVariationSettings added in api level 28. Api doc here

Respondent: Midhilaj

Solution #2:

This is caused by an incompatibility with the android support library that changed to version 28. I solved the problem by forcing the build to use a lower support library. //like build gradle

configurations.all {
        resolutionStrategy {
                force ''

My project built successfully immediately after I changed this. Hope this might help you too. I lost a day of development because of this!.

Respondent: zyc zyc

Solution #3:

For those that must keep compileSdkVersion 27 and are unable to upgrade to androidx yet, you must not upgrade to (or over) the versions of dependencies in the following links. These links are where the breaking change was introduced. You must find an earlier version that doesn’t use androidx.

For instance, the following are compatible with compileSdkVersion 27:

dependencies {
    implementation ''
    implementation ''
    implementation ''
    implementation ''
    implementation ''
    implementation ''

The following will break with compileSdkVersion 27 and are only compatible with compileSdkVersion 28:

dependencies {
    implementation ''
    implementation ''
    implementation ''
    implementation ''
    implementation ''
    implementation ''
Respondent: akhil

Solution #4:

If you are updating to v28

change the compileSdkVersion to compileSdkVersion 28

Respondent: Regular User

Solution #5:

I solve this problem with the line below:

cordova plugin add cordova-android-support-gradle-release --save

After that the compile was succesful.

Respondent: Pablo Cegarra

Solution #6:

For native Android apps (not Cordova) solution for me is:


implementation ''


implementation ''
Respondent: John Prado

Solution #7:

@All the issue is because of the latest major breaking changes in the google play service and firebase June 17, 2019 release.

If you are on Ionic or Cordova project. Please go through all the plugins where it has dependency google play service and firebase service with + mark


In my firebase cordova integration I had
So the plus always downloading the latest release which was causing error. Change + with version number as per the March 15, 2019 release

Make sure to replace + symbols with actual version in build.gradle file of cordova library

Respondent: Eugene Voronoy

Solution #8:

Another fix for Ionic 3 devs is to create build-extras.gradle
inside platforms/android and put following

configurations.all {
    resolutionStrategy {
        force ''

Note that build-extras.gradle is not the same as build.gradle

Respondent: bheema

Solution #9:

I encountered this error in a flutter project and all I had to do update my compileSdkVersion to 28.


  1. In your app level build.gradle file, search for compileSdkVersion
  2. Check the current version
  3. If less than 28, update it to 28

As zyc zyc stated above, the property fontVariationSettings was added in API level 28.

You can also read more about it here

Respondent: Filip Floryan

Solution #10:

Usually it’s because of sdk versions and/or dependencies.

For Cordova developers, put your dependencies settings in “” file under CORDOVA_PROJECT_ROOT/platforms/android/ folder, like this:


So if you use CLI “cordova build“, it will overwrite the dependencies section:

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
   /* section being overwritten by cordova, referencing */

If you are using proper libraries and its versions in, you should be fine.

Solution #11:

after upgrading to Android 3.4.2 and FTC SDK5.2. I got these errors when building APK:

Android resource linking failed
C:UsersidsidFTCSkyStoneTeamCodeuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:1205: error: resource android:attr/fontVariationSettings not found.
C:UsersidsidFTCSkyStoneTeamCodeuildintermediatesincrementalmergeDebugResourcesmerged.dirvaluesvalues.xml:1206: error: resource android:attr/ttcIndex not found.
error: failed linking references.

What I did is to add following section to project build gradle and problem is fixed.

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 28
                buildToolsVersion '29.0.2'

Good luck.

Respondent: Joanne

Solution #12:

This was a pain in the ass for me! Especially after updating to Android Studio 3.2.1 and Gradle 4.6 (for Gradle developers).

I think there is more than one factor that could cause such a build exception. For me, I had the following lines of code in my file (using SDK version 27):


AndroidX is the alternative to Android’s default Support Library and should be used when compiling and targeting SDK version 28 (API 28). Before the updating Android Studio and Gradle, I had added the lines above in preparation to eventually fully migrate to AndroidX to use SDK version 28 and the build ran successfully. It was only after the update that I received an error similar to that above:

error: resource android:attr/fontVariationSettings not found

Hope this helps.

Respondent: Steven Wang

Solution #13:

If you have stumbled upon this problem due to getting this error recently out of nowhere in react native- this is due to the latest BREAKING CHANGE in Google Play service and Firebase. Check this thread first –

And solution would mostly be like this –

Respondent: marvatron

Solution #14:

I had the same error, but don’t know why it appeared. After searching solution I migrated project to AndroidX (Refactor -> Migrate to AndroidX…) and then manually changed whole classes imports etc. and in layout files too (RecyclerViews, ConstraintLayouts, Toolbars etc.).
I changed also compileSdkVersion and targetSdkVersion to 28 version and whole project/application works fine.

Respondent: Anirudha Paul

Solution #15:

If anybody has this error using phonegap or cordova with the cordova-plugin-fcm-ng or cordova-plugin-fcm plugin, the solution that worked for me is creating the extra config file for gradle “build-extras.gradle” in the platformsandroidapp folder, and putting the following lines in it

configurations.all {
 resolutionStrategy {
  force ''
  force ''

I found this solution reading this page, in particular comment of shreyakupadhyay on 30/07/19 and consulting about last libraries version.

Respondent: Slepster

Solution #16:

error: resource android:attr/fontVariationSettings not found

I got this error when i added ButterKnife library but upgrading compileSdkVersion to 28 and targetSdk to 28 solved my issue.

Solution #17:

For Ionic 3 devs. I had to update the platforms/android/ file ONLY on:


to be v4:28.0.0+ otherwise the build kept failing.

After doing so, my file contents are shown below:


I hope this helps someone. Was a real problem for me.

Respondent: Raveesh G S

Solution #18:

For me : My external library was using this attributes attr/fontVariationSettings and attr/ttcIndex so I downgrade my library version and sync project . everything fine

So now :

 compileSdkVersion 27 
 implementation ''

and for future readers that library was google’s easypermission.

implementation 'pub.devrel:easypermissions:2.0.0'

This lib is using sdkversion 28, I have to downgrade to 1.3.0

Respondent: Tony Ross

Solution #19:

I have soled the problem by changing target android version to 28 in (target=android-28) and installed cordova-plugin-androidx and cordova-plugin-androidx-adapter.

Respondent: Tejas Pandya

Solution #20:

I had this problem suddenly happening after trying to pull a dependency depending on sdk 28 (firebase crashlytics), but then decided to revert back the changes.

I tried automatic refactor Migrate to Androidx (which do half the job), added android.useAndroidX=true in at some points, and make the project work again.

But it was a lot of changes before a delivery. There was no way to have the project compile again with SDK 27. I git clean -fd, removed $HOME/.gradle, and kept seeing androidx in ./gradlew :app:dependencies

I ended up removing ~/.AndroidStudio3.5/ too (I’m on 3.5.3). This makes the project compile again, and I discovered the dark mode…

Respondent: Manoj Alwis

Solution #21:

I just got this AndroidX error again after I fixed it a year ago. I am using Flutter.

I was able to make releases using Flutter 1.7.8+hotfix.4, then recently I updated Flutter to version 1.17.4 and then I could not compile a release build any more. Debug builds worked just fine.

This time it was a package using another package that was not updated proper for AndroidX
Make sure to update your packages! 🙂

Error message: Important part

[+1099 ms] > Task :package_info:verifyReleaseResources FAILED 
[  +10 ms] FAILURE: Build failed with an exception. 
[  +10 ms] * What went wrong: 
[  +29 ms] Execution failed for task ':package_info:verifyReleaseResources'. 
[   +3 ms] Android resource linking failed 
[   +7 ms]  ...uildpackage_infointermediates
eleasevaluesvalues.xml:171:error: resource android:attr/fontVariationSettings not found. 
[   +2 ms] ...uildpackage_infointermediates
eleasevaluesvalues.xml:172:error: resource android:attr/ttcIndex not found.     
[   +1 ms] error: failed linking references.

Error message: Distraction

       FAILURE: Build failed with an exception.

       * What went wrong:
       A problem occurred configuring root project 'barcode_scan'.
       > SDK location not found. Define location with sdk.dir in the file or with an ANDROID_HOME environment variable.

“fontVariationSettings not found”. is an AndroidX error, which requires you to use compileSdkVersion 28, but I already had that, so I suspect something was implemented between my two Flutter versions to be more restrictive.

So I had to go hunting and updated packages and found that.
“package_info: ^0.3.2” needed to be “package_info: ^0.4.0” to make it work.
To make it “more” future proof write it like this:

package_info: '>=0.4.0 <2.0.0'

After updating packages my code base compiles for release again.
Hope it helps.

Respondent: FredG

Solution #22:

I removed all the unused plugins in the pubspec.yaml and in the External Libraries to solve the problem.

Respondent: Bo Kristensen

Solution #23:

My case was really different. I had set android:text=” ??? “ property of my TetxtView in my layout file, when I changed it to android:text=” ? “ it worked. I have no idea why this works, maybe it helps someone. It took me hours to find the issue.

Respondent: hatted

Solution #24:

I had the same issue and I installed this cordova plugin and problem solved.

cordova plugin add cordova-android-support-gradle-release --save
Respondent: yrazlik

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy