Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maui Application Cannot Find Splash Screen Resource

Tags:

maui

The Package.appxmanifest in my Maui application (latest version, .NET 6, VS 17.4 Preview 1) cannot "find" the Splash Screen file I specify in the Splash Screen field, resulting in a DEP0700 error (see below).

The Visual Assets tab of the Package.appxmanifest looks like this:

enter image description here

The Resources\Splash\mysplash.png file sits on disk as mysplash.svg:

enter image description here

It's my understanding that Maui converts the svg file to a png file during compilation and that the app manifest should reference the png file as a result.

For the record, I also tried these path/file name references in the Splash Screen field before recompiling and none of them worked:

Resources\Splash\mysplash.png 
Splash\mysplash.png 
mysplash.png 
Resources\Splash\mysplash.svg 
Splash\mysplash.svg
mysplash.svg

I get this when building:

DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(33,27): error 0x80070003: Cannot install or update package 0ecaf7bf-457c-450a-94a5-181406568f05_9zz4h110yvjzm because the splash screen image [mysplash.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.

EDIT: The Build Action is indeed set to MauiSplashScreen.

enter image description here

This really should not be so difficult. It would be great if the error message provided gave a clue as to where the system is looking for the file, if the file is there but is just in the wrong format, or some other clues...

Does anyone have any ideas?

like image 772
Jazimov Avatar asked Mar 10 '26 21:03

Jazimov


1 Answers

I've run into this a lot, especially after a reclone or deleting bin and obj folders. For anyone else finding this, and you know there's nothing wrong with the image (as I did), I've established this is definitely glitchy behaviour, and you just need to persist. Rebuild seems to work the best, but I say I can confirm it's glitchy behaviour cos I just had it and did a rebuild, and it didn't fix the issue. Then I rebuilt it again and it worked after the 2nd rebuild! There's something dodgy going on somewhere, but I'm not sure what.

P.S. this was on Windows. It works every time to begin with on Android.

P.P.S. having run into this again, and noticed an error message at the first rebuild, it's definitely part of my workflow now to just rebuild twice (sigh). I have 2 repos in my solution now, and though the rebuild of the library worked first time, the rebuild of the app failed - I didn't see why. So when I delete bin and obj folders (which I have to do when I increment the version, as msbuild fails to pick it up for some reason - the app displays the right version, but the package displays the old version), I now have to...

  1. dotnet restore solutionname
  2. rebuild
  3. rebuild again ..and only THEN does my Windows app work and show the right version number everywhere.

NEW update! The above isn't working anymore either! (sigh) What I EVENTUALLY found is that not only did I have to increment the version number in the csproj, but ALSO in the properties. i.e. now I have to increment the version number in 2 different places for Windows to pick it up (still works first time with Android just updating the csproj).

like image 54
donaldp Avatar answered Mar 12 '26 09:03

donaldp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!