3

I just updated to Android Studio 3.6.1 and the most up-to-date gradle versions and now my project won't build with the error

.gradle/caches/transforms-2/files-2/<some-hash-number>/navigation-common-1.0.0-alpha01/res/values/values.xml:16:5-21-25: AAPT: error: resource attracts/type not found

I attempted to clear my cache and rebuild, but it didn't help. So I also tried a Invalidate Caches and Restart, and that also didn't change anything. Not sure what else to try...

EDIT: Added Values.xml.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="NavAction">
        <attr name="android:id"/>
        <attr format="reference" name="destination"/>
        <attr format="boolean" name="launchSingleTop"/>
        <attr format="boolean" name="launchDocument"/>
        <attr format="boolean" name="clearTask"/>
        <attr format="reference" name="popUpTo"/>
        <attr format="boolean" name="popUpToInclusive"/>
        <attr format="reference" name="enterAnim"/>
        <attr format="reference" name="exitAnim"/>
        <attr format="reference" name="popEnterAnim"/>
        <attr format="reference" name="popExitAnim"/>
    </declare-styleable>
    <declare-styleable name="NavArgument">
        <attr name="android:name"/>
        <attr name="android:defaultValue"/>
        <!--free format since in future it could be Parcelable-->
        <attr name="type"/>
    </declare-styleable>
    <declare-styleable name="NavDeepLink">
        <attr format="string" name="uri"/>
        <attr name="android:autoVerify"/>
    </declare-styleable>
    <declare-styleable name="NavGraphNavigator">
        <attr format="reference" name="startDestination"/>
    </declare-styleable>
    <declare-styleable name="Navigator">
        <attr name="android:id"/>
        <attr name="android:label"/>
    </declare-styleable>
</resources>
BlondeSwan
  • 772
  • 5
  • 26

1 Answers1

13

I had the same problem after upgrading to Android Studio 3.6. To fix it, I had to add the format of my custom view attributes in my attrs.xml file. E.g.

<declare-styleable name="TheCustomView">
    <attr name="custom_view_attribute" />
</declare-styleable>

became:

<declare-styleable name="TheCustomView">
    <attr name="custom_view_attribute" format="string" />
</declare-styleable>
Tash Pemhiwa
  • 7,590
  • 4
  • 45
  • 49