Comments (12)
Ok, figured out what the problem is:
If you add an image to UWP's Assets folder (or to any other location within the solution), and point image control's Source property to that image, an app would never complete loading.
from uno.
@MarkStega indeed, seems like a minor path parsing issue. Should be easy to fix :) Hang on for the source to be published.
from uno.
If you put the image in the UWP asset folder (in the UWP Head project), it won't be available for other heads.
Is it possible for you to fork the repo and share a commit reproducing the problem? (or any other way to give us more information to reproduce it) I would love to fix the problem for you :-).
(by the way, congrats, you're the first one to report a bug on this repo!)
from uno.
from uno.
@danielkornev "local" files should be available in the wasm app if the build action is set to Content
. It seems that for now, wasm does not support this properly, we'll fix it.
Thanks for trying uno out !
from uno.
from uno.
Also make sure to use the ms-appx
URI scheme:
<Image Source="ms-appx:///Assets/image.png" />
from uno.
I can confirm that any reference to an image causes an error to be thrown during the load of that image. I tried both 'Source="/Assets/ImageName.png"' and 'Source="ms-appx:///Assets/ImageName.png"'. Both versions work in a UWP app; Neither work in wasm.
The first few lines of the error from the console:
mono.js:1 Error #1 "TypeError: Cannot read property 'toString' of undefined" executing javascript: "(function(t){document.title = t;})("Uno Playground");" put_char @ mono.js:1 mono.js:1 �[41m�[30mfail�[39m�[22m�[49m: Windows.UI.Core.CoreDispatcher[0] mono.js:1 Dispatcher unhandled exception mono.js:1 System.Exception: Failed to load Page Optimiser.NG.MainPage System.InvalidOperationException: This operation is not supported for a relative URI. mono.js:1 at System.Uri.get_Scheme () <0x1e38ba0 + 0x0001c> in <3d11b0248be143f5a11160eae8e61e3e>:0 mono.js:1 at Windows.UI.Xaml.Media.ImageSource.InitFromUri (System.Uri uri) <0x1e38a58 + 0x00010> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at Windows.UI.Xaml.Media.Imaging.BitmapImage.OnUriSourceChanged (Windows.UI.Xaml.DependencyPropertyChangedEventArgs A_0) <0x1e4be58 + 0x00044> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at Windows.UI.Xaml.Media.Imaging.BitmapImage+<>c.<.cctor>b__58_0 (Windows.UI.Xaml.DependencyObject s, Windows.UI.Xaml.DependencyPropertyChangedEventArgs e) <0x1e4be00 + 0x00024> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at (wrapper delegate-invoke) <Module>.invoke_void_DependencyObject_DependencyPropertyChangedEventArgs(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.DependencyPropertyChangedEventArgs) mono.js:1 at Windows.UI.Xaml.PropertyMetadata.RaisePropertyChanged (Windows.UI.Xaml.DependencyObject source, Windows.UI.Xaml.DependencyPropertyChangedEventArgs e) <0x1c50dc0 + 0x0002c> in <c839eae4007e4ef3bcf083ab0250456d>:0
from uno.
I updated my nugget packages and it doesn't work for me on wasm (uwp yes).
Source="ms-appx:///Assets/pictures/user.png"
from uno.
@BeaumerF The package that fixed this was not published, you can try updating again, it should work better now.
from uno.
@jeromelaban It still doesn't work on my project, the local images let the app on the splash screen (I updated, cleaned and built)
from uno.
Still doesn't work. I've added an image to Assets folders in both UWP and Android projects, but image just doesn't shop up:
Here's what I get instead (button has background color just to make sure it's positioned where it is):
My Android Phone is Samsung Note 8, with Android 8.0 (Oreo) on it.
Here's the layout I've built in XAML:
<Page
x:Class="ZU.Assistant.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" FontFamily="Segoe UI Black">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Border Margin="0,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="40" Background="#FF66AEE7">
<TextBlock Text="ZET UNIVERSE: ASSISTANT" FontSize="18" FontFamily="Segoe UI Black" Foreground="White" FontWeight="Bold" HorizontalAlignment="Left" Height="17" Padding="0" Margin="25,11,0,0" VerticalAlignment="Top" Width="325" />
</Border>
<Button Height="50" Width="150" Content="Hello world!" VerticalAlignment="Center" HorizontalAlignment="Center" Click="Button_Click"/>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Height="52">
<Button x:Name="speakToMeButton" HorizontalAlignment="Center" VerticalAlignment="Top" Width="50" Height="50" Padding="-2" Background="Transparent" BorderThickness="0">
<Border Padding="0" Width="50" Height="50" Background="#FF66AEE7" CornerRadius="25" BorderThickness="1" BorderBrush="White">
<Image Width="48" Height="48" Source="ms-appx:///Assets/Mic-WF.png"/>
</Border>
</Button>
</Grid>
</Grid>
</Page>
from uno.
Related Issues (20)
- [WASM] keepalive C# generator executes in F# project HOT 1
- Is __LINUX__ missing? HOT 2
- [Skia] Measure/Arrange occur too many times in `Given_Border.When_Child_Set_Same_Reference`
- Typo in Uno.Implicit.Packages.targets
- NuGet override doesn't play nicely with non-uno-runtime-enabled packages HOT 1
- Compile error when using a PackageReference that is not updated to last Uno Platform version HOT 3
- Build fails after Changing the Application Display Version HOT 2
- WPF SelfContained Support (non-cross)
- WPF SelfContained Support (cross)
- ClickOnce Support
- Enhanced .dmg image publish
- Ubuntu Snap Support
- Flatpak Support
- AppImage Support
- Tarball Publish Support
- When using a multi Window, the event Closed or Unloaded on a control is never called HOT 1
- [WASM] `DoubleAnimation` with Converter Behaves Weirdly but works with `Setters`
- [ski Linux] The app does not scale properly on a laptop with a big resolution HOT 6
- WebView2 - External links issue
- WinAppSdk + Single Project *.csproj : Can't command line build because of `GenerateSplashAssets_... task failed unexpectedly`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uno.