question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Vector images from native resources is not working

See original GitHub issue

Based on React Native documentation, we should be able to fetch images from native resources. This is works great on iOS, but in Android you can’t load vector images using uri.

React Native version:

react-native: 0.61.5

Steps To Reproduce

Placing vector image named image.xml in drawable folder and using this code, is not working: <Image width={100} height={100} source={{ uri: 'image' }} style={{ width: 100, height: 100 }} />

Placing the vector image in assets folder and using this code, is not working either: <Image width={100} height={100} source={{ uri: 'asset:/image.xml' }} style={{ width: 100, height: 100 }} />

Note that placing .jpg or .png images is working without any issues.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:10

github_iconTop GitHub Comments

1reaction
yonatanganotcommented, Jul 21, 2020

still exist in version 0.63.1

0reactions
mattmcdonald-ukcommented, Apr 29, 2022

This issue still exists in 0.68 (the originally reported issue, unrelated to splash screens).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resources$NotFoundException when using vector images on ...
Resources $NotFoundException when using vector images on API22 but not on API24 · It looks like is having some trouble loading res/drawable-anydpi ...
Read more >
Add multi-density vector graphics - Android Developers
In the Resources dialog, select Drawable in the left pane, and then select the vector drawable you imported. Click OK. The vector drawable ......
Read more >
Manage your app's UI resources with Resource Manager
You can add image assets, vector assets, fonts, resource files and values, or you can import resources into your project.
Read more >
Drawable resources - Android Developers
A bitmap image. Android supports bitmap files in the following formats: .png (preferred), ,webp (preferred, requires API level 17 or higher) ...
Read more >
ImageView - Android Developers
Displays image resources, for example Bitmap or Drawable resources. ImageView is also commonly used to apply tints to an image and handle image...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found