SergeyMell / nativescript-plugins

Apache License 2.0
14 stars 4 forks source link

SVG are not displayed in Android but correctly in iOS #17

Closed phenric closed 3 years ago

phenric commented 3 years ago

Hello Github!

Thanks for this plugin!

In {N}7, the SVG are not displayed in Android. The iOS version is doing fine.

I dropped the SVG files in /App_Resources/iOS/ and /App_Resources/Android/src/main/res/ and the calls to those files are done like that:

<SVGImage src="res://path"></SVGImage>

I also added this line { from: '**/*.svg', noErrorOnMissing: true, globOptions: { dot: false, ...copyIgnore } } in webpack.config.js.

Is there an additional config in Android that I miss?

SergeyMell commented 3 years ago

If you are using resources for your svg files try to add them to drawable-nodpi folder of the /App_Resources/Android/src/main/res/ directory. However, there is no need to use resources since you can simply use assets (actually webpack configuration tweaking is required exactly for copying svg from the assets folder)

phenric commented 3 years ago

Thx it perfectly works!