dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

APT0003 and other errors with new template #19489

Closed hawkerm closed 1 week ago

hawkerm commented 9 months ago

Description

I was able to create a new .NET Maui Blazor Hybrid project in one of my existing project solutions, but when I create it in another, I can't build the file->new template. There are older Xamarin based projects in this solution compared to my other solution which is working which did not have a prior Xamarin based project. Though looking at the font file being complained about, it's the same in both cases. I can't reply to the old issue as it's locked, so filing a new issue here:

The project needs to be deployed before we can debug. Please enable Deploy in the Configuration Manager.
Severity    Code    Description Project File    Line    Suppression State
Error       DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(34,27): error 0x80070002: Cannot install or update package com.companyname.app.mbh_9zz4h110yvjzm because the splash screen image [$placeholder$.png] cannot be located. Verify that the package contains an image that can be used as a splash screen for the application, and that the package manifest points to the correct location in the package where this splash screen image can be found.  App.MBH         
Error   APT0003 Invalid file name: It must contain only [^a-zA-Z0-9_.]+.    App.MBH App.MBH\Resources\Fonts\OpenSans-Regular.ttf    1   

Related to #3896

I'm not even trying to run Android at the moment, just Windows.

VS 17.8.3 on Windows 10 22H2 19045.3803

I do see warnings in the dependency here in Android which I didn't see in my other project:

image

Though doesn't say what they are.

It also spits out error IDE1100 about not being able to read the netstandard2.0 AssemblyInfo.cs file in obj\Debug.

Steps to Reproduce

  1. Open an existing Xamarin/Uno Platform based solution (4.x)
  2. Add a new project of .NET Maui Blazor Hybrid
  3. Try to compile/run the .NET Maui Blazor Hybrid app on Windows...

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.3

Affected platforms

Android, Windows

Affected platform versions

No response

Did you find any workaround?

No

Relevant log output

DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(34,27): error 0x80070002: Cannot install or update package com.companyname.app.mbh_9zz4h110yvjzm because the splash screen image [$placeholder$.png] cannot be located. Verify that the package contains an image that can be used as a splash screen for the application, and that the package manifest points to the correct location in the package where this splash screen image can be found.

🤷‍♂️ This is a file->new template, I don't know what this is referring too. Same template worked fine in my other solution.
PureWeen commented 9 months ago

Can you attach binlog?

https://github.com/xamarin/xamarin-macios/wiki/Diagnosis

hawkerm commented 9 months ago

@PureWeen attached here: msbuild.zip

Zhanglirong-Winnie commented 7 months ago

Verified this issue with Visual Studio 17.10.0 Preview 1. Can repro on windows platform. This is an unstable problem.

mkArtakMSFT commented 5 months ago

Can somebody please try this out with the latest .NET 8.0.3 SDK and see if this still happens?