[Android] Vector images from native resources is not working
See original GitHub issueBased 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:
- Created 4 years ago
- Reactions:7
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
still exist in version 0.63.1
This issue still exists in 0.68 (the originally reported issue, unrelated to splash screens).