2016-09-08 52 views
0

我得到這個例外

Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_ic_ab_back_material.xml from drawable resource ID #0x7f020016 

我嘗試在

ContextCompat.getDrawable(this, android.support.v7.appcompat.R.drawable.abc_ic_ab_back_material); 
// ofc i used full path to support-v7 library icon, but i hadnt access to my code right now :(

搖籃2.1版 Android的支持庫版本,以獲得該圖標24.2.0 異常出現在api19(4.4.4)

加入defaultConfig這一行didnt解決問題

vectorDrawables.useSupportLibrary = true 

複製圖標到我的繪製目錄didnt解決問題過分

也許誰知道一些技巧來避免此異常?

+0

用'useSupportLibrary',不應該聲明:'android.R.drawable.abc_ic_ab_back_material'? – Shaishav

+0

我編輯的問題。 我使用android.support.v7.appcompat.R.drawable.abc_ic_ab_back_material。 它會解決,如果我將使用android.R.drawable.abc_ic_ab_back_material? 對不起,我的英語不好( –

+0

)[你也] [https://imgur.com/a/g7mdk]錯誤嗎? – Shaishav

回答

0

將drawable複製到project res文件夾中解決了問題。謝謝Shaishav

相關問題