0

In my build.gradle (Module: app), I was using classpath 'com.android.tools.build:gradle:3.0.1' and I changed it to classpath 'com.android.tools.build:gradle:3.2.0'. The BUILD FAILED showing the following message:

Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  C:\Users\[path]\build\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:376: error: resource android:attr/fontStyle not found.
  C:\Users\[path]\build\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:376: error: resource android:attr/font not found.
  C:\Users\[path]\build\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:376: error: resource android:attr/fontWeight not found.
  error: failed linking references.

  Command: C:\Users\jaimemontoya\.gradle\caches\transforms-2\files-2.1\ea0620af930b84caf3e943ec51a7a3cc\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
          C:\Users\jaimemontoya\AppData\Local\Android\Sdk\platforms\android-23\android.jar\
          --manifest\
          C:\Users\[path]\build\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\[path]\build\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\[path]\build\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\[path]\build\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --proguard-main-dex\
          C:\Users\[path]\build\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
          --custom-package\
          com.couponclub\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\[path]\build\app\build\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0
  Output:  C:\Users\jaimemontoya\.gradle\caches\transforms-2\files-2.1\1c4ab5294eb582683d1d0ae5418e25a1\res\values\values.xml:28:1-40:21: AAPT: error: resource android:attr/fontStyle not found.

  C:\Users\jaimemontoya\.gradle\caches\transforms-2\files-2.1\1c4ab5294eb582683d1d0ae5418e25a1\res\values\values.xml:28:1-40:21: AAPT: error: resource android:attr/font not found.

  C:\Users\jaimemontoya\.gradle\caches\transforms-2\files-2.1\1c4ab5294eb582683d1d0ae5418e25a1\res\values\values.xml:28:1-40:21: AAPT: error: resource android:attr/fontWeight not found.

  error: failed linking references.
  Command: C:\Users\jaimemontoya\.gradle\caches\transforms-2\files-2.1\ea0620af930b84caf3e943ec51a7a3cc\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
          C:\Users\jaimemontoya\AppData\Local\Android\Sdk\platforms\android-23\android.jar\
          --manifest\
          C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --proguard-main-dex\
          C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt\
          --custom-package\
          com.couponclub\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\jaimemontoya\Dropbox\CuponClub\androidapp\build\app\build\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 3m 27s

Any ideas about a fix for this? It seems to be complaining about missing resources related to fonts and font styles, but I am not sure what I should do to fix it.

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
  • 1
    Maybe under file, Invalidate Cache and restart? Sometimes the caching causes issues when making gradle changes – Brandon Apr 29 '19 at 17:16
  • @Brandon It does not fix the problem. I used the `File > Invalidate Caches / Restart...` option and the problem persists. – Jaime Montoya Apr 29 '19 at 18:05
  • 1
    Possible duplicate of [unable to find attribute android:font for v7 support](https://stackoverflow.com/questions/47062650/unable-to-find-attribute-androidfont-for-v7-support) – dglozano Apr 30 '19 at 01:00

1 Answers1

0

I kept com.android.tools.build.gradle:3.0.1 but did these two things:

  1. Installed `Android SDK Platform 28 (platforms;android-28)
  2. Replaced compileSdkVersion 23 with compileSdkVersion 28 in `build.gradle (Module: app)

enter image description here enter image description here

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103