Aapt2Exception的资源

Aapt2Exception的资源

本文介绍了错误:配置'.aapt.v2.Aapt2Exception的资源'attr/orientation'的重复值异常:Android资源编译失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个编译错误!我在stackoverflow上检查了类似的问题,但它们都是关于不同的错误& ;;而不是"attr/orientation"和"配置,但是它们对我的问题没有作用!我正在使用androidx库,kotlin,Gradle 4.10.1,

I've got this compile error!I checked similar problems on stackoverflow but all of them were about different errors & not " attr/orientation' with config '' ", but they didn't work for my problem!I'm using androidx library , kotlin ,Gradle 4.10.1 ,

我执行了以下步骤,但仍然没有结果:

I do these steps, but still no result:

1-清洁项目

2-重建

3-使缓存无效/重新启动

3- Invalidate caches / Restart

4-在该文件夹上创建了另一个attrs.xml文件:res-> values-v21

4- made another attrs.xml file on the folder : res->values-v21

5种其他方式...

5-so many other ways...

但是所有这些都失败了!有解决办法吗?

but all of them just failed!Any solution?

推荐答案

我发现了问题,这是一个错误,我将其报告给了Google(b.android.com)&他们回答了

I find the problem, it is a bug and I reported it to Google ( b.android.com ) & they answered

.

那么如何解决它: 在build.gradle(Module)中更新到库的alpha3版本时,我遇到了问题:

So how to solve it: I faced the problem when updated to alpha3 version of library in build.gradle (Module) :

  implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'

只需将其降级到较低版本:

Just downgrade it to lower version:

  implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'

现在可以了.

问题是Constraintlayout:2.0.0-alpha3库和attrs.xml在编译时合并之间的冲突!

The problem was the conflict between constraintlayout:2.0.0-alpha3 library and attrs.xml merging on compile time!

对您来说,可能只是其他一些库之间的冲突(只需检查最近更新的库)

and for you it might be just conflicts between some other libraries ( just check last updated libraries )

这篇关于错误:配置'.aapt.v2.Aapt2Exception的资源'attr/orientation'的重复值异常:Android资源编译失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 11:14