我刚刚更新到Android Studio 3.6.1和最新的gradle版本,现在我的项目将不会构建错误
.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我试图清除缓存并重新构建,但没有帮助。所以我也尝试了无效缓存和重启,这也没有改变任何事情。不知道还能尝试什么.
编辑:添加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>发布于 2020-03-05 16:19:20
在升级到Android Studio 3.6之后,我也遇到了同样的问题。要解决这个问题,我必须在attrs.xml文件中添加我的自定义视图属性的格式。例如。
<declare-styleable name="TheCustomView">
<attr name="custom_view_attribute" />
</declare-styleable>变成了:
<declare-styleable name="TheCustomView">
<attr name="custom_view_attribute" format="string" />
</declare-styleable>https://stackoverflow.com/questions/60536172
复制相似问题