错误:资源“attr/orientation"与配置“.aapt.v2.Aapt2Exception"的重复值:Android 资源编译失败 [英] error: duplicate value for resource 'attr/orientation' with config '' .aapt.v2.Aapt2Exception: Android resource compilation failed

查看:40
本文介绍了错误:资源“attr/orientation"与配置“.aapt.v2.Aapt2Exception"的重复值: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

是的,我们知道这个问题,它将在下一个 alpha 版本中修复.这是:问题链接

Yep, we are aware of this issue, it will be fixed in the next alpha release. this is the : issue link

.

那么如何解决:我在 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 )

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

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆