android.content.res.Resources$NotFoundException解决方

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

Error


11-17 18:31:56.437: E/AndroidRuntime(13460): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010017 a=-1} 


This is a tricky time wasting type of error that has many causes, below i will be listing some of my adventures with this error


Solution


CASE 1: If You have reference attribute in attr.xml and you have many themes, you need to fill this attribute in all of these themes


attr.xml


style.xml


      


CASE 2: Spelling mistake or may be the drawable is not really found in drawable folders


CASE 3: You are using an "android attribute" (ex: ?android:attr/listDivider" ) 

that is not supported by your current OS Version 


CASE 4: The theme containing your reference is not applied to the Activity (either in Manifest or by using setTheme ) that is you have an attribute reference in your activity's layout but the theme filling this attribute is not applied to the Activity 




IMPORTANT NOTE: If this error happened once, you will need to uninstall/install the App for the fix to be applied ( may be to clear some cache for App files )

来源:http://karim-ouda.blogspot.com/2013/11/androidcontentresresourcesnotfoundexcep.html

转载于:https://my.oschina.net/u/1244156/blog/309448

你可能感兴趣的:(android.content.res.Resources$NotFoundException解决方)