0


I'm using svg format icons in my app. my application's minimum API level is 21 and target is 24. I knew that I can convert svg format icons into usual android vectors by android studio's "Vector asset" tool. ( which is accessible if you right-click on res/drawable directory -> new -> vector asset. )
Created vectors by this approach result well in android api higher than 21. but it causes app crashing in android 5 devices. though in google's documentation on vector assets it is said that vector assets are supported on api level 21 and higher.

Is there any idea that what can I do with this?

here's a sample of errors while app is trying to inflate an activity/fragment xml and a vector asset causes the crash:

android.view.InflateException: Binary XML file line #26: Error inflating class ImageView

  • Post your xml please – Emre Aktürk May 14 '18 at 14:09
  • Post your xml and java code – Thankgod Richard May 14 '18 at 14:11
  • This most certainly not version problem. Beside my experience of successfully using vector assets on API17 there is note in Android doc stating compatibility: "For backward-compatibility, Vector Asset Studio generates raster images of the vector drawable." – Gotiasits May 14 '18 at 14:30
  • @Gotiasits I think that was the exact problem, I fixed it by converting the svg from an online convertor. – Arman Ramezanzadeh May 16 '18 at 09:49
  • That's great! You can help others by answering your own question, explaining the solution and sharing tool you used. – Gotiasits May 16 '18 at 10:33
  • @ArmanRamezanzadeh it is not a proper solution, online converter convert the svg with different format and tags in xml. I am facing same issue and using online converter also it is crashing for some vecctors – Ashim Kansal Apr 10 '19 at 08:21
  • I am facing the same issue. But only in some svgs, others are drawing correctly. Don't know what's the issue!!!..Any ideaa – shine_joseph Apr 24 '19 at 12:56

0 Answers0