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版本。或者降控件版本