You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From Martin's report
So after quite a bit of debugging I finally have some answers 😂 . In the end Resizetizer is indeed causing the problem. If you build the sample above and extract the apk, you will find that all of the SVGs are included not only as .svg in the root assets folder:
But Resizetizer also generates png versions of them in drawable folders, even though at least two of them are explicitly "removed" in the .csproj:
This is unfortunately a big problem because our code does the following:
FindResourceIdFromPath unfortunately does not include the file extension in the name which means it just searches for a resource with name unosvgandroidtests_assets_flowbite_opensource for example, so the condition of the if passes and it tries to read the svg from the png file -> which makes it fail, even though it should use the Android Asset instead. I could theoretically invert the if to give precedence to the asset instead, but there still are other issues:
We need to generate the Android resource names including their extension (I will take care of this)
We must add a way for the user to explicitly ignore a file or even better a wildcard pattern (like Assets/Svg/**.svg) and avoid processing it completely so that those drawables that could conflict will not be generated (plus so the apk does not contain duplicates unnecessarily when the user actually wants a SVG file)
The text was updated successfully, but these errors were encountered:
From Martin's report
So after quite a bit of debugging I finally have some answers 😂 . In the end Resizetizer is indeed causing the problem. If you build the sample above and extract the
apk
, you will find that all of the SVGs are included not only as.svg
in the rootassets
folder:But Resizetizer also generates
png
versions of them indrawable
folders, even though at least two of them are explicitly "removed" in the.csproj
:This is unfortunately a big problem because our code does the following:
FindResourceIdFromPath
unfortunately does not include the file extension in the name which means it just searches for a resource with nameunosvgandroidtests_assets_flowbite_opensource
for example, so the condition of theif
passes and it tries to read thesvg
from thepng
file -> which makes it fail, even though it should use the Android Asset instead. I could theoretically invert theif
to give precedence to the asset instead, but there still are other issues:Assets/Svg/**.svg
) and avoid processing it completely so that those drawables that could conflict will not be generated (plus so theapk
does not contain duplicates unnecessarily when the user actually wants a SVG file)The text was updated successfully, but these errors were encountered: