xamarin – image is not displaying in release

Published

I am using xamarin.forms and visual studio

following code works fine in debug or release mode. image shows up just fine.

companyLogo_white.svg is inside my shared project and build-action is embedded resource

issue: I than launched this app on playstore. Issue is that this image doesn’t get displayed. i have no idea as to what could be the issue.

        <ffsvg:SvgCachedImage x:Name="ssImage"   
   Source="resource://AppName.Extra.Resources.infographic.companyLogo_white.svg" 
                              WidthRequest="300" HeightRequest="300"
                              VerticalOptions="CenterAndExpand" 
                              HorizontalOptions="CenterAndExpand"/>

Android mainacitivy.cs

       FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true);
        FFImageLoading.Svg.Forms.SvgCachedImage.Init();
        var ignore = typeof(SvgCachedImage);

AppName.csproj

  <ItemGroup>
      ....
    <EmbeddedResource Include="ExtraResourcesinfographiccompanyLogo_white.svg" />
  </ItemGroup>

svg image code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="1.1"
   id="svg2"
   xml:space="preserve"
   width="1200"
   height="1200"
   viewBox="0 0 1200 1200"
   sodipodi:docname="companyLogo_white.ai"><metadata
     id="metadata8"><rdf:RDF><cc:Work
         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
     id="defs6"><clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath22"><path
         d="M 0,900 H 900 V 0 H 0 Z"
         id="path20" /></clipPath><clipPath
       clipPathUnits="userSpaceOnUse"
       id="clipPath98"><path
         d="M 0,900 H 900 V 0 H 0 Z"
         id="path96" /></clipPath></defs><sodipodi:namedview
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1"
     objecttolerance="10"
     gridtolerance="10"
     guidetolerance="10"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:window-width="640"
     inkscape:window-height="480"
     id="namedview4" /><g
     id="g10"
     inkscape:groupmode="layer"
     inkscape:label="companyLogo_white"
     transform="matrix(1.3333333,0,0,-1.3333333,0,1200)"><g
       id="g12"
       transform="translate(611.1841,597.7054)"><path
         d="m 0,0 -8.726,-118.021 -74.609,63.264 z"
         style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
         id="path14" /></g><g
       id="g16"><g
         id="g18"
         clip-path="url(#clipPath22)"><g
           id="g24"
           transform="translate(527.631,542.5123)"><path
             d="m 0,0 c -10.98,-35.777 -21.961,-71.555 -32.941,-107.332 l -58.023,46.82 C -60.643,-40.342 -30.321,-20.171 0,0"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path26" /></g><g
           id="g28"
           transform="translate(681.2116,643.5178)"><path
             d="m 0,0 -27.051,-94.243 -41.886,49.085 z"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path30" /></g><g
           id="g32"
           transform="translate(681,643)"><path
             d="M 0,0 C -21.5,0.083 -43,0.167 -64.5,0.25 -124.667,-53.611 -184.833,-107.472 -245,-161.333"
             style="fill:#5d676e;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path34" /></g><g
           id="g36"
           transform="translate(617.7288,643.5178)"><path
             d="m 0,0 -180.794,-161.637 -82.736,-73.97 39.328,103.475 z"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path38" /></g><g
           id="g40"
           transform="translate(617.7288,643.5178)"><path
             d="m 0,0 -278.365,-164.052 38.395,103.841 z"
             style="fill:#5d676e;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path42" /></g><g
           id="g44"
           transform="translate(616.8561,643.2996)"><path
             d="m 0,0 -308.906,-78.317 -18.325,10.471 133.946,45.376 z"
             style="fill:#a8a9ab;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path46" /></g><g
           id="g48"
           transform="translate(615.9835,643)"><path
             d="m 0,0 h -240.842 l 48.43,-22.688 z"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path50" /></g><g
           id="g52"
           transform="translate(423.125,620.75)"><path
             d="m 0,0 c -24.433,-8.604 -48.863,-17.222 -73.29,-25.857 -24.587,-8.69 -49.165,-17.395 -73.736,-26.113 l -53.666,44.309 37.523,29.911 c 38.431,0.042 76.863,0.083 115.294,0.125 7.557,-3.664 15.229,-7.321 23.016,-10.965 C -16.498,7.497 -8.21,3.695 0,0"
             style="fill:#dcdcdc;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path54" /></g><g
           id="g56"
           transform="translate(259.0832,643)"><path
             d="M 0,0 H -61.083 L -36.65,-29.669 Z"
             style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path58" /></g><g
           id="g60"
           transform="translate(619.0377,643)"><path
             d="M 0,0 C -30.013,42.583 -60.025,85.167 -90.038,127.75 -200.371,85.167 -310.704,42.583 -421.038,0 Z"
             style="fill:#5d676e;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path62" /></g><g
           id="g64"
           transform="translate(530.1667,771.1667)"><path
             d="m 0,0 c -61.722,-23.889 -123.444,-47.778 -185.167,-71.667 17.756,21.044 35.511,42.087 53.266,63.13 C -87.934,-5.691 -43.967,-2.846 0,0"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path66" /></g><g
           id="g68"
           transform="translate(618.75,643.25)"><path
             d="M 0,0 C 20.748,-0.083 41.496,-0.167 62.243,-0.25 L -7.13,88.757 C -4.753,59.171 -2.377,29.586 0,0"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path70" /></g><g
           id="g72"
           transform="translate(674.5,651)"><path
             d="M 0,0 C 4.928,14.958 9.856,29.917 14.783,44.875 -10.978,56.771 -36.739,68.667 -62.5,80.563 -41.667,53.708 -20.833,26.854 0,0"
             style="fill:#5d676e;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path74" /></g><g
           id="g76"
           transform="translate(619,643.25)"><path
             d="M 0,0 C -2.314,29.758 -4.629,59.516 -6.943,89.275 -23.879,86.516 -40.814,83.758 -57.75,81 Z"
             style="fill:#030303;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path78" /></g><g
           id="g80"
           transform="translate(561.4449,724.2349)"><path
             d="M 0,0 95.552,15.707 5.743,60.203 C 3.828,40.135 1.914,20.068 0,0"
             style="fill:#343c40;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path82" /></g><g
           id="g84"
           transform="translate(561.5,724.25)"><path
             d="m 0,0 c 1.872,20.065 3.745,40.13 5.617,60.195 l -96.861,70.246 C -60.829,86.961 -30.414,43.48 0,0"
             style="fill:#030303;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path86" /></g><g
           id="g88"
           transform="translate(455.6667,766.4167)"><path
             d="M 0,0 C 24.528,1.528 49.056,3.056 73.583,4.583 53.628,32.917 33.673,61.25 13.717,89.583 9.145,59.722 4.572,29.861 0,0"
             style="fill:#a8a9ab;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path90" /></g></g></g><g
       id="g92"><g
         id="g94"
         clip-path="url(#clipPath98)"><g
           id="g100"
           transform="translate(199.3843,274.4034)"><path
             d="m 0,0 c 4.895,-10.233 9.789,-20.466 14.684,-30.699 1.694,2.82 3.388,5.639 5.082,8.458 -1.882,3.877 -3.765,7.755 -5.647,11.632 4.061,-0.054 8.122,-0.108 12.182,-0.162 3.066,-6.481 6.132,-12.962 9.198,-19.443 4.881,10.071 9.762,20.143 14.643,30.214 3.967,-0.027 7.934,-0.042 11.9,-0.069 C 53.656,-18.518 45.27,-37.403 36.884,-55.403 h -2.797 c -3.039,7 -6.078,13.434 -9.117,20.158 -3.2,-6.683 -6.4,-13.372 -9.601,-20.055 -0.82,-0.013 -1.64,-0.03 -2.46,-0.043 C 4.491,-36.948 -3.926,-18.555 -12.344,-0.16 -8.229,-0.106 -4.115,-0.054 0,0"
             style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
             id="path102" /></g><g
           id="g104"
           transform="translate(325.5534,247.2682)"><path
             d="m 0,0 c 0,-12.833 -10.403,-23.236 -23.236,-23.236 -12.832,0 -23.235,10.403 -23.235,23.236 0,12.833 10.403,23.236 23.235,23.236 C -10.403,23.236 0,12.833 0,0 Z"
             style="fill:none;stroke:#ffffff;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
             id="path106" /></g><path
           d="m 367.399,219.192 h -10.865 v 55.507 h 10.865 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path108" /><path
           d="m 358.148,219.192 h 29.905 v 10.542 h -29.905 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path110" /><path
           d="m 424.09,219.192 h -10.757 v 55.507 h 10.757 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path112" /><path
           d="m 413.763,242.212 h 32.272 v 11.08 h -32.272 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path114" /><path
           d="m 413.333,274.699 h 37.328 v -11.08 h -37.328 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path116" /><path
           d="m 515.957,263.619 h -42.168 v 11.295 h 42.168 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path118" /><path
           d="m 489.602,267.922 h 10.972 v -48.838 h -10.972 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path120" /><path
           d="m 539.408,274.914 h 37.22 v -11.295 h -37.22 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path122" /><path
           d="m 539.408,229.841 h 37.22 v -11.188 h -37.22 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path124" /><path
           d="m 539.408,253.185 h 30.335 v -11.188 h -30.335 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path126" /><g
           id="g128"
           transform="translate(639.1274,228.8733)"><path
             d="m 0,0 c -1.741,-1.242 -8.28,-5.596 -16.781,-4.41 -9.633,1.343 -18.659,9.361 -19.686,20.223 -0.93,9.827 5.045,18.192 11.711,21.845 4.37,2.395 8.742,2.602 10.879,2.682 6.497,0.241 11.499,-1.861 13.985,-3.12"
             style="fill:none;stroke:#ffffff;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
             id="path130" /></g><path
           d="m 681.188,218.977 h -11.295 v 55.4 h 11.295 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path132" /><path
           d="m 677.961,242.643 h 25.495 v 10.65 h -25.495 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path134" /><path
           d="m 712.707,218.977 h -11.295 v 55.4 h 11.295 z"
           style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="path136" /><g
           id="g138"
           transform="translate(711,292)"><path
             d="M 0,0 V 57 H -525 V 0"
             style="fill:none;stroke:#ffffff;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
             id="path140" /></g><g
           id="g142"
           transform="translate(711,209)"><path
             d="M 0,0 V -63 H -525 V 0"
             style="fill:none;stroke:#ffffff;stroke-width:8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
             id="path144" /></g></g></g></g></svg>

Source: Xamarin.ios Questions

Published
Categorised as Uncategorised Tagged , , , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq