Reputation: 637
I am using vector drawables programmatically instead of png like :
getSupportActionBar().setHomeAsUpIndicator(getResources().getDrawable(R.drawable.ic_navigate_before_black_24dp));
Everything is working fine but the app crashes in android 4.2 & below. Am getting the following log
Caused by: android.content.res.Resources$NotFoundException:
at android.content.res.Resources.loadDrawable (Resources.java:2842)
at android.content.res.Resources.getDrawable (Resources.java:1521)
at android.app.Activity.performCreate (Activity.java:5326)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1097)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2218)
Caused by: org.xmlpull.v1.XmlPullParserException:
at android.graphics.drawable.Drawable.createFromXmlInner (Drawable.java:917)
at android.graphics.drawable.Drawable.createFromXml (Drawable.java:858)
at android.content.res.Resources.loadDrawable (Resources.java:2839)
I am using gradle 3.0.1 and also added
vectorDrawables.useSupportLibrary = true
still no help.
Upvotes: 0
Views: 1771
Reputation: 2764
<path>
. Sometimes this happens when <path>
tag in XML file is too long. drawable
to drawable-nodpi
.UPDATE
Upvotes: 6