Giter Club home page Giter Club logo

Comments (12)

danielkornev avatar danielkornev commented on August 16, 2024 1

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.

jeromelaban avatar jeromelaban commented on August 16, 2024 1

@MarkStega indeed, seems like a minor path parsing issue. Should be easy to fix :) Hang on for the source to be published.

from uno.

carldebilly avatar carldebilly commented on August 16, 2024

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.

danielkornev avatar danielkornev commented on August 16, 2024

from uno.

jeromelaban avatar jeromelaban commented on August 16, 2024

@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.

danielkornev avatar danielkornev commented on August 16, 2024

from uno.

miguelrochefort avatar miguelrochefort commented on August 16, 2024

Also make sure to use the ms-appx URI scheme:

<Image Source="ms-appx:///Assets/image.png" />

from uno.

MarkStega avatar MarkStega commented on August 16, 2024

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.

BeaumerF avatar BeaumerF commented on August 16, 2024

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.

jeromelaban avatar jeromelaban commented on August 16, 2024

@BeaumerF The package that fixed this was not published, you can try updating again, it should work better now.

from uno.

BeaumerF avatar BeaumerF commented on August 16, 2024

@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.

danielkornev avatar danielkornev commented on August 16, 2024

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:

image

Here's what I expect to see:
image

Here's what I get instead (button has background color just to make sure it's positioned where it is):
screenshot_20180930-152004_zuassistant

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.