Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run apps after publish for Linux or Windows #19000

Open
brswan opened this issue Dec 4, 2024 · 8 comments
Open

Can't run apps after publish for Linux or Windows #19000

brswan opened this issue Dec 4, 2024 · 8 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@brswan
Copy link

brswan commented Dec 4, 2024

Current behavior

I created a new project using the Uno extensions for VisualStudio. I am able to run the default sample app within Visual Studio debugger.

image

  1. Linux Publish Issue - Blank Screen

I am able to publish for linux-arm64 but when I run on my device, the screen remains blank.

Please see attached for linux logs.

linux-arm64-logs.txt

  1. Window Publish Issue - SDK Issue?
    When running the published version on Windows I get the following error in Windows Event Viewer:
    CoreCLR Version: 8.0.1124.51707
    .NET Version: 8.0.11
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.InvalidOperationException: Unable to find the Microsoft.WindowsDesktop.App framework. An Uno Platform update may be required (Expected path D:\dev\test\UnoLatestSingleProject_02\UnoLatestSingleProject_02\bin\Release\net8.0-desktop\Microsoft.WindowsDesktop.App\win-x64)
    at Uno.UI.Runtime.Skia.WpfHostBuilder.RegisterAssemblyResolver(Boolean useSharedFramework)
    at Uno.UI.Runtime.Skia.WpfHostBuilder..ctor()
    at Uno.UI.Runtime.Skia.HostBuilder.<>c__DisplayClass0_0.b__0()
    at Uno.UI.Runtime.Skia.SkiaHostBuilder.Build()

I have performed uno-check and it appears I have no issues:
image

Expected behavior

Default app should be published to linux-arm64 and appear as normal. Default app should be able to run on win x64

How to reproduce it (as minimally and precisely as possible)

  • Create a new project in Visual Studio 2022
  • Select Uno Platform App
    1. Platforms - only leave Desktop checked
    1. Presentation - MVVM
  • Select Create

Open Program.cs and add the following lines to set the ApplicationDataPathOverride and LocalCacheFolderPathOverride
WinRTFeatureConfiguration.ApplicationData.ApplicationDataPathOverride = "/home/test/data";
WinRTFeatureConfiguration.ApplicationData.LocalCacheFolderPathOverride = "/home/test/cache";

Workaround

None at this time

Works on UWP/WinUI

No

Environment

No response

NuGet package version(s)

image
image
image

Affected platforms

Skia (GTK), Windows (WinAppSDK)

IDE

Visual Studio 2022

IDE version

17.12.3

Relevant plugins

No response

Anything else we need to know?

No response

@brswan brswan added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Dec 4, 2024
@jeromelaban
Copy link
Member

Thanks for the report. We'll likely split the issues as they are unrelated.

I am able to publish for linux-arm64 but when I run on my device, the screen remains blank.

Can you provide the command line that you used to publish your app? Can you also provide the linux environmnt that you're using ? uname -a and lsb_release -a will help.

When running the published version on Windows I get the following error in Windows Event Viewer:

By the looks of it, it seems that there's a mismatch in the versions used to run the app. Try building your app with net9.0 instead of net8.0.

@jeromelaban jeromelaban added the triage/needs-information Indicates an issue needs more information in order to work on it. label Dec 4, 2024
@brswan
Copy link
Author

brswan commented Dec 4, 2024

@jeromelaban Thanks for your assistance. Please see responses below:

Thanks for the report. We'll likely split the issues as they are unrelated.

I am able to publish for linux-arm64 but when I run on my device, the screen remains blank.

Copy. Do you need me to make two separate issues?

Can you provide the command line that you used to publish your app?

I'm using the Visual Studio GUI publishing tool:

Linux Publish
image

Windows Publish
image

Can you also provide the linux environmnt that you're using ? uname -a and lsb_release -a will help.

When running the published version on Windows I get the following error in Windows Event Viewer:

We are building our system from scratch using Yacto - I'm not the linux guy but if you need more info I can get it for you.
uname -a
Linux 6.4.0-linaro-lt-qcom+ #1 SMP PREEMPT Fri Jul 28 19:37:37 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

lsb_release doesn't appear to be included in our build.

By the looks of it, it seems that there's a mismatch in the versions used to run the app. Try building your app with net9.0 instead of net8.0.

I only have net8.0-desktop available to publish with from the drop down
image

@github-actions github-actions bot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Dec 4, 2024
@jeromelaban
Copy link
Member

jeromelaban commented Dec 4, 2024

Thanks. Could you do the publish on the command line using the documented steps and let us know if it helps?

For linux, this may look like a distribution specific issue, which may be missing some packages that are implicitly required by Skia to run. This is the list of dependencies that are known to be required. Your distribution may require some more, and we'd like to know them.

I only have net8.0-desktop available to publish with from the drop down

You need to change your csproj TargetFrameworks in order to do this.

@brswan
Copy link
Author

brswan commented Dec 4, 2024

Using the following command: dotnet publish -f net8.0-desktop -r win-x64 -p:SelfContained=true

Results
dotnet publish -f net8.0-desktop -r win-x64 -p:SelfContained=true
Determining projects to restore...
Restored D:\dev\test\UnoLatestSingleProject_02\UnoLatestSingleProject_02\UnoLatestSingleProject_02.csproj (in 436 ms).
UnoLatestSingleProject_02 -> D:\dev\test\UnoLatestSingleProject_02\UnoLatestSingleProject_02\bin\Release\net8.0-desktop\win-x64\UnoLatestSingleProject_02.dll
UnoLatestSingleProject_02 -> D:\dev\test\UnoLatestSingleProject_02\UnoLatestSingleProject_02\bin\Release\net8.0-desktop\win-x64\publish\

Workload updates are available. Run dotnet workload list for more information.

Running with this generates the following error - which does look like a .net mismatch. Is there a way to force it to net8.0? We are targeting this framework.

image

@brswan
Copy link
Author

brswan commented Dec 4, 2024

dotnet workload list

Installed Workload Id Manifest Version Installation Source
android 35.0.7/9.0.100 SDK 9.0.100, VS 17.12.35527.113
aspire 8.2.2/8.0.100 SDK 9.0.100, VS 17.12.35527.113
ios 18.0.9617/9.0.100 SDK 9.0.100, VS 17.12.35527.113
maccatalyst 18.0.9617/9.0.100 SDK 9.0.100, VS 17.12.35527.113
macos 15.0.9617/9.0.100 SDK 9.0.100
maui 9.0.0/9.0.100 SDK 9.0.100
maui-windows 9.0.0/9.0.100 SDK 9.0.100, VS 17.12.35527.113
wasm-tools 9.0.0/9.0.100 SDK 9.0.100

@jeromelaban
Copy link
Member

You can force building with .NET 8 using a global.json file, and set the rollForward to latestMinor.

@brswan
Copy link
Author

brswan commented Dec 5, 2024

@jeromelaban I should clarify that I can run on my linux box using the older style template where each platform has it's own project:
Skia.Linux.FrameBuffer
Skia.GTK
Skia.Wpf

I am able to publish to WPF and GTK and run without issues. Does this new all-in-one solution style use new dependencies?

FYI - We are using Wayland and not X11 on our Linux box.

@jeromelaban
Copy link
Member

Thanks for the update.

It's best if you move to the newer project format, as it uses the latest backend that relies on X11 directly and not GTK (GTK causes a lot of issues). In your case, it will use XWayland to render. It does also build in a single target net8.0-desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

2 participants