Why are my Xamarin UWP Images not showing up on device?

前端 未结 4 1189
忘掉有多难
忘掉有多难 2021-01-27 10:32

I am developing a Xamarin UWP app using ffimageloading. The images show up just fine on the Windows Phone emulator that I am running through Visual Studio, but when I deploy it

相关标签:
4条回答
  • 2021-01-27 11:07

    I had the same problem whenever I kept the image file inside any folder (for. eg assests). But later i started keeping the images file in the main project folder; I didn't keep them inside any folders and they started to show up in the application.

    0 讨论(0)
  • 2021-01-27 11:10

    The issue was the build configuration. By turning off "Compile with .NET Native tool chain" on the Build tab of Properties for the Release configuration of the main UWP app and deploying the app with WinAppDeployCmd.exe

    0 讨论(0)
  • 2021-01-27 11:10

    I also had the issue with images not showing up on my UWP app. The images were showing up on my Android project but not UWP. For me the solution was to add the file extension. For some reason "myimage" works on Android but not on UWP, has to include the file extension like "myimage.png". Just wanna leave this here for anyone else potentially experiencing the same issue.

    0 讨论(0)
  • 2021-01-27 11:14

    To get "Compile with .NET Native tool chain" working you have to use UWP-specific overload of the Forms.Init call which allows to correctly include FFImageLoading assemblies for Xamarin.Forms usage:

    // you'll need to add `using System.Reflection;`
    List<Assembly> assembliesToInclude = new List<Assembly>();
    
    //Now, add in all the assemblies your app uses
    assembliesToInclude.Add(typeof (FFImageLoadingAssembliesHere).GetTypeInfo().Assembly);
    
    //Also do this for all your other 3rd party libraries
    
    Xamarin.Forms.Forms.Init(e, assembliesToInclude);
    // replaces Xamarin.Forms.Forms.Init(e);
    
    0 讨论(0)
提交回复
热议问题