欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Execution failed for task ‘:app:processDebugResources‘.

程序员文章站 2022-07-02 23:14:26
Execution failed for task ':app:processDebugResources'.> com.android.ide.common.process.ProcessException: Failed to execute aaptAttribute "android:translationX" has already been definedAttribute "android:translationY" has already been definedA....

Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

 

Attribute "android:translationX" has already been defined

Attribute "android:translationY" has already been defined

Attribute "android:translationZ" has already been defined

说是属性已经定义,重复定义了。

一般就是build.gradle文件的问题了。毕竟translationX等属性我并没有自定义,那就是你导入的官方的第三方控件引起冲突,与自身项目的compileSdkVersion 和buildToolsVersion 不匹配,查看是不是某个引入的控件太高或太低版本,导致不兼容

如:

implementation 'com.android.support.constraint:constraint-layout:2.0.4'

而我的

compileSdkVersion 28
buildToolsVersion '28.0.3'

显然,版本并不匹配,可能是因为implementation 'androidx.constraintlayout:constraintlayout:2.0.4'。需要升级为androidx,能与之匹配的gradle版本。或者降控件版本

本文地址:https://blog.csdn.net/qq_31622345/article/details/111925130