今天更新AS之后,之前有一個老的項目出現(xiàn)如上所示的問題诡曙,導(dǎo)致build失敗湿右。查看錯誤問題之后發(fā)現(xiàn)代碼是如下格式的:
<item name="animator" type="id">false</item>
<item name="date_picker_day" type="id">false</item>
然后網(wǎng)上找到了一些資料:
在開發(fā)文檔中,https://developer.android.com/guide/topics/resources/more-resources#Id
也有提到說上面那種方式已經(jīng)不能這么寫了票髓,新的方法如下:
<item name="animator" type="id"/>
<item name="date_picker_day" type="id"/>
如果引入的是第三方包怎么修改呢?
1铣耘、在你的項目res\values文件夾下新建ids.xml
文件
2洽沟、將之前編譯出錯的item重新寫一遍,改成下面的
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="animator" type="id"/>
<item name="date_picker_day" type="id"/>
...
</resources>
重新build之后AS會自動處理這些問題蜗细。