3 回答

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

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>
添加回答
舉報