亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

帶有配置的資源“attr/strokeWidth”的重復值

帶有配置的資源“attr/strokeWidth”的重復值

慕少森 2021-10-13 10:16:26
我剛剛將支持庫從 27 更新到 28,但它沒有成功構建,出現以下錯誤:Android resource compilation failedOutput:  /AndroidProjects/Brand App/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:1052: error: duplicate value for resource 'attr/strokeWidth' with config ''./AndroidProjects/Brand App/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:1052: error: resource previously defined here.Command: /Users/apple/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-osx.jar/509e285e62be11c8bb7437cdd445c1df/aapt2-3.2.0-4818971-osx/aapt2 compile --legacy \        -o \        /AndroidProjects/Brand App/app/build/intermediates/res/merged/debug \        /AndroidProjects/Brand App/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xmlDaemon:  AAPT2 aapt2-3.2.0-4818971-osx Daemon #0
查看完整描述

3 回答

?
素胚勾勒不出你

TA貢獻1827條經驗 獲得超9個贊

遇到同樣的問題,我的是配置文件中的 attr/shape,問題基本上與使用 android 默認庫的庫沖突有關,請粘貼完整的問題并更新您正在使用的任何第三方庫,它會起作用。我更新了其中一個庫,問題得到解決。因為我使用的是舊版本的 com.facebook.shimmer 并且我剛剛在 gradle 中更新了它并且它起作用了。


查看完整回答
反對 回復 2021-10-13
?
拉風的咖菲貓

TA貢獻1995條經驗 獲得超2個贊

這發生在我身上,因為我有以下屬性定義與strokeWidthandroid 支持庫中的 new 沖突:


 <declare-styleable name="CountdownView">

     <attr name="widgetHeight" format="dimension" />

     <attr name="widgetWidth" format="dimension" />

     <attr name="animationDurationMs" format="integer" />

     <attr name="animationRepeatCount" format="integer" />

     <!-- strokeWidth was the conflict -->

     <attr name="strokeWidth" format="integer" />

     <attr name="paintTextSize" format="dimension" />

 </declare-styleable>

使用的支持庫format="dimension"我使用的同時format="integer"。更改以format="dimension"解決問題,無論如何都是正確的格式:


 <declare-styleable name="CountdownView">

     <attr name="widgetHeight" format="dimension" />

     <attr name="widgetWidth" format="dimension" />

     <attr name="animationDurationMs" format="integer" />

     <attr name="animationRepeatCount" format="integer" />

     <!-- strokeWidth now matches support library -->

     <attr name="strokeWidth" format="dimension" />

     <attr name="paintTextSize" format="dimension" />

 </declare-styleable>


查看完整回答
反對 回復 2021-10-13
?
瀟瀟雨雨

TA貢獻1833條經驗 獲得超4個贊

我遇到了同樣的問題,因為我創建了一個自定義按鈕,并使用了 colorPrimary。這仍然是一個奇怪的錯誤,當我從自定義按鈕中刪除顏色時已解決。


查看完整回答
反對 回復 2021-10-13
  • 3 回答
  • 0 關注
  • 179 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號