錯誤記錄android.view.InflateException: Binary XML file line?[#2]: Error inflating class <unknown>

錯誤反饋于 Android 4.4 設備,在高等級 Android 設備上無問題。

錯誤信息:

android.view.InflateException: Binary XML file line [#2]: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.kongzue.dialog.v3.ShareDialog.refreshView(ShareDialog.java:278)
......

檢查XML文件后發(fā)現(xiàn),使用了API 21才支持的水波紋效果:

android:background="?android:attr/selectableItemBackgroundBorderless"

并圖省事用了忽略錯誤警告:

tools:ignore="NewApi"

問題解決方案:


layout

根據(jù) API 等級創(chuàng)建不同的布局,問題解決。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容