Search code examples
androidaapt2

Many errors appeared after i added a recycler-view dependency in my project


My app worked fine and compilated untill i added

com.android.support:recyclerview-v7:28.0.0-alpha1 in my project.

Here are my errors:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\Smith\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\455a076f8084ee34b277fdfdb97836e0\res\values\values.xml
Error:(203, 5) error: resource android:attr/fontStyle not found.
Error:(203, 5) error: resource android:attr/font not found.
Error:(203, 5) error: resource android:attr/fontWeight not found.
Error:(203, 5) error: resource android:attr/fontVariationSettings not found.
Error:(203, 5) error: resource android:attr/ttcIndex not found.
C:\Users\Smith\AndroidStudioProjects\DontSleepManager\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(314) resource android:attr/fontStyle not found.
Error:(314) resource android:attr/font not found.
Error:(314) resource android:attr/fontWeight not found.
Error:(314) resource android:attr/fontVariationSettings not found.
Error:(314) resource android:attr/ttcIndex not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 29s
Information:15 errors
Information:0 warnings
Information:See complete output in console

enter image description here

If i add the line

android.enableAapt2=false

in gradle-properties then i get next warnings:

enter image description here

Please help me to figure out that


Solution

  • Try to change com.android.support:recyclerview-v7:28.0.0-alpha1 to com.android.support:recyclerview-v7:25.3.1.

    And take a look at this question